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