Skip to content

Commit 7ec055b

Browse files
committed
actions: improve release workflow
1 parent 208703b commit 7ec055b

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,25 @@ jobs:
3737
cp ${{github.workspace}}/build/pico-ident.uf2 ${{github.workspace}}/pico-ident-usb.uf2
3838
3939
- name: Create release
40-
uses: ncipollo/release-action@v1.10.0
41-
id: create_release
42-
with:
43-
draft: false
44-
prerelease: false
45-
artifacts: "${{github.workspace}}/pico-ident-*.uf2"
46-
artifactErrorsFailBuild: true
47-
generateReleaseNotes: true
48-
token: ${{ github.token }}
40+
env:
41+
TAG_NAME: ${{ github.ref_name }}
42+
GH_TOKEN: ${{ github.token }}
43+
run: |
44+
release_args=(
45+
"$TAG_NAME"
46+
--title "${TAG_NAME}"
47+
--target "$GITHUB_SHA"
48+
--generate-notes
49+
)
50+
51+
labeled_assets=(
52+
"${{github.workspace}}/pico-ident-uart.uf2#pico-ident UF2 (UART)"
53+
"${{github.workspace}}/pico-ident-usb.uf2#pico-ident UF2 (USB)"
54+
)
55+
56+
# check for e.g., v1.1.0-rc0
57+
if [[ $TAG_NAME == *-* ]]; then
58+
release_args+=( --prerelease )
59+
fi
60+
61+
gh release create "${release_args[@]}" -- "${labeled_assets[@]}"

0 commit comments

Comments
 (0)