Skip to content

Commit

Permalink
ci: avoid zip in zip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythologyli committed Feb 6, 2023
1 parent 40f1864 commit d610766
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, RELEASE_NAME: $_NAME"
echo "::set-output name=ASSET_NAME::$_NAME"
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
Expand All @@ -96,24 +97,27 @@ jobs:
run: |
mkdir -p build_assets
go build -v -o build_assets/ZJUConnect -trimpath -ldflags "-s -w -buildid=" .
- name: Rename Windows ZJUConnect
if: matrix.goos == 'windows'
run: |
cd ./build_assets || exit 1
mv ZJUConnect ZJUConnect.exe
- name: Upload artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: ZJUConnect-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
path: build_assets/*

- name: Create ZIP archive
if: github.event_name == 'release'
run: |
pushd build_assets || exit 1
zip -9vr ../ZJUConnect-$ASSET_NAME.zip .
popd || exit 1
- name: Upload artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: ZJUConnect-${{ steps.get_filename.outputs.ASSET_NAME }}
path: ZJUConnect-${{ steps.get_filename.outputs.ASSET_NAME }}.zip

- name: Upload release binary
if: github.event_name == 'release'
env:
Expand Down

0 comments on commit d610766

Please sign in to comment.