Skip to content

Commit 428366e

Browse files
workflow update
1 parent 5e38b08 commit 428366e

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

.github/workflows/publish-singlefile.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
contents: write
1313

1414
jobs:
15-
publish:
15+
release:
1616
# matrix: build on Ubuntu and Windows
1717
runs-on: ${{ matrix.os }}
1818
strategy:
@@ -46,32 +46,38 @@ jobs:
4646
if: runner.os == 'Windows'
4747
run: Remove-Item artifacts\${{ matrix.rid }}\*.pdb -Force
4848

49-
- name: Upload build artifact
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: app-${{ matrix.rid }}
53-
path: artifacts/${{ matrix.rid }}
49+
- name: Zip artifact (Linux)
50+
if: runner.os == 'Linux'
51+
run: |
52+
cd artifacts
53+
zip -r ${{ matrix.rid }}.zip ${{ matrix.rid }}
54+
55+
- name: Zip artifact (Windows)
56+
if: runner.os == 'Windows'
57+
shell: powershell
58+
run: |
59+
Compress-Archive -Path artifacts\${{ matrix.rid }}\* `
60+
-DestinationPath artifacts\${{ matrix.rid }}.zip
5461
5562
- name: Create GitHub Release
5663
id: create_release
5764
uses: actions/create-release@v1
5865
env:
5966
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6067
with:
61-
# also explicitly pass it in:
62-
token: ${{ secrets.GITHUB_TOKEN }}
63-
tag_name: ${{ github.ref_name }}
68+
tag_name: ${{ github.ref_name }}
6469
release_name: Release ${{ github.ref_name }}
65-
body_path: CHANGELOG.md
66-
draft: false
67-
prerelease: false
70+
body_path: CHANGELOG.md
71+
draft: false
72+
prerelease: false
6873

69-
- name: Upload Release Assets
74+
# 2) Upload that single ZIP file
75+
- name: Upload Release Asset (${{ matrix.rid }})
7076
uses: actions/upload-release-asset@v1
7177
env:
7278
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7379
with:
74-
upload_url: ${{ steps.create_release.outputs.upload_url }}
75-
asset_path: artifacts/${{ matrix.rid }}/**
76-
asset_name: '${{ matrix.rid }}-build.zip'
80+
upload_url: ${{ steps.create_release.outputs.upload_url }}
81+
asset_path: artifacts/${{ matrix.rid }}.zip
82+
asset_name: ${{ matrix.rid }}-build.zip
7783
asset_content_type: application/zip

0 commit comments

Comments
 (0)