Skip to content

Commit

Permalink
zip
Browse files Browse the repository at this point in the history
  • Loading branch information
rindeal committed Aug 9, 2024
1 parent df19855 commit a3866e3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,18 @@ jobs:
- run: meson compile --jobs 4 --verbose -C build
- run: meson install --destdir "${BASENAME}" -C build
env: { BASENAME: "${{ steps.setup.outputs.basename }}", }
- run: zip -r "${BASENAME}.zip" "build/${BASENAME}"
if: runner.os != 'Windows'
env: { BASENAME: "${{ steps.setup.outputs.basename }}", }
- run: |
$files = Get-ChildItem -Path "build/$env:BASENAME" -Recurse
$files | ForEach-Object { Write-Output $_.FullName }
Compress-Archive -Path "build/$env:BASENAME" -DestinationPath "$env:BASENAME.zip" -Force
shell: pwsh
env: { BASENAME: "${{ steps.setup.outputs.basename }}", }
if: runner.os == 'Windows'
- name: ZIP it
shell: python
run: |
import os, pathlib, zipfile
basename = os.getenv('BASENAME')
source = pathlib.Path(f"build/{basename}")
with zipfile.ZipFile(f"{basename}.zip", 'w') as zf:
for file in source.rglob('*'):
if file.is_file():
relative = file.relative_to(source)
print(f"adding: {relative}")
zf.write(file, relative)
- run: gh release upload --clobber "${GH_TAG}" "${BASENAME}.zip"
env:
BASENAME: "${{ steps.setup.outputs.basename }}"
Expand Down

0 comments on commit a3866e3

Please sign in to comment.