Skip to content

Commit 56b5bf6

Browse files
authored
ci: upload build artifacts to GH releases (#11)
1 parent 8fecc29 commit 56b5bf6

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ on:
88
# This avoids having duplicate builds in non-forked PRs
99
- "master"
1010
- "sisdk-*"
11-
tags:
12-
# normal versions
13-
- "v[0-9]+.[0-9]+.[0-9]+"
14-
# pre-releases
15-
- "v[0-9]+.[0-9]+.[0-9]+-**"
11+
release:
12+
types:
13+
- published
1614
pull_request: {}
1715

1816
# Cancel previous PR/branch runs when a new commit is pushed
@@ -79,10 +77,13 @@ jobs:
7977
id: version
8078
run: |
8179
VERSION=$(node tools/extract_version.mjs)
80+
if [ "${{ github.event_name }}" == "release" ]; then
81+
SUFFIX="$VERSION"
82+
else
83+
COMMIT=$(git rev-parse --short ${{ github.sha }})
84+
SUFFIX="${VERSION}_${COMMIT}"
85+
fi
8286
echo "VERSION=${VERSION}" >> $GITHUB_ENV
83-
COMMIT=$(git rev-parse --short ${{ github.sha }})
84-
echo "COMMIT=${COMMIT}" >> $GITHUB_ENV
85-
SUFFIX="$VERSION_$COMMIT"
8687
echo "SUFFIX=${SUFFIX}" >> $GITHUB_ENV
8788
8889
- name: Copy HEX file
@@ -135,6 +136,12 @@ jobs:
135136
name: zwa2_controller_${{ env.SUFFIX }}
136137
path: upload/*.*
137138

139+
- name: Upload to release
140+
if: github.event_name == 'release'
141+
uses: softprops/action-gh-release@v2
142+
with:
143+
files: upload/*.*
144+
138145
- name: Debug Build failures
139146
if: failure()
140147
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)