Update ci.yml
This commit is contained in:
parent
ea33ee758e
commit
87974d8822
|
@ -34,8 +34,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Fetch all tags
|
|
||||||
run: git fetch --force --tags
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
|
@ -55,16 +54,14 @@ jobs:
|
||||||
export LD_FLAGS="-w -s -X main.VERSION=unknown"
|
export LD_FLAGS="-w -s -X main.VERSION=unknown"
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" ./
|
go build -o "output/$BINARY_NAME" -trimpath -ldflags "$LD_FLAGS" ./
|
||||||
echo "FIRMWARE=$PWD/output" >> $GITHUB_ENV
|
|
||||||
echo "::set-output name=status::success"
|
|
||||||
|
|
||||||
- name: Generate release tag
|
- name: Generate release tag
|
||||||
id: tag
|
id: tag
|
||||||
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
|
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")"
|
echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")"
|
||||||
echo "::set-output name=status::success"
|
echo "::set-output name=status::success"
|
||||||
|
|
||||||
- name: Upload firmware to release
|
- name: Upload firmware to release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: steps.tag.outputs.status == 'success' && !cancelled()
|
if: steps.tag.outputs.status == 'success' && !cancelled()
|
||||||
|
@ -72,7 +69,7 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.tag.outputs.release_tag }}
|
tag_name: ${{ steps.tag.outputs.release_tag }}
|
||||||
files: $FIRMWARE/*
|
files: env.FIRMWARE/*
|
||||||
|
|
||||||
- name: Delete workflow runs
|
- name: Delete workflow runs
|
||||||
uses: GitRML/delete-workflow-runs@main
|
uses: GitRML/delete-workflow-runs@main
|
||||||
|
|
Loading…
Reference in New Issue