Update ci.yml

This commit is contained in:
序列号 2023-03-19 18:53:14 +08:00 committed by GitHub
parent ae79b4a2cd
commit a4db7384bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -8,6 +8,7 @@ env:
COMMIT_ID: "${{ github.sha }}"
PR_PROMPT: "::warning:: Build artifact will not be uploaded due to the workflow is trigged by pull request."
LD_FLAGS: "-w -s"
HEAD_REF: "true"
jobs:
build:
@ -55,15 +56,17 @@ jobs:
go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" ./
- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ !github.head_ref }}
if: ${{ !head_ref }}
with:
name: ${{ matrix.goos }}_${{ matrix.goarch }}
path: output/
- name: Upload firmware directory
uses: actions/upload-artifact@main
if: true
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
if: ${{ head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ matrix.goos }}_${{ matrix.goarch }}
path: output/
tag_name: ${{ matrix.goos }}_${{ matrix.goarch }}
files: output/*