Skip to content

Commit c05d5c4

Browse files
committed
.github: Add release workflow.
This was the only step that wasn't automated, which made it a bit harder to remember what to do. Fixes pybricks/support#1558
1 parent 190c0a4 commit c05d5c4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v3.*'
5+
6+
name: Create release
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
upload_release:
13+
name: Upload Release Assets
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Create release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
tag: ${{ github.ref_name }}
20+
run: |
21+
if [[ "${{ contains(env.GITHUB_TAG, 'a') || contains(env.GITHUB_TAG, 'b') || contains(env.GITHUB_TAG, 'c') }}" == "true" ]]; then
22+
PRERELEASE_FLAG="--prerelease"
23+
else
24+
PRERELEASE_FLAG=""
25+
fi
26+
gh release create "$tag" \
27+
--repo="$GITHUB_REPOSITORY" \
28+
--title="${tag#v}" \
29+
-F CHANGELOG.md \
30+
$PRERELEASE_FLAG

0 commit comments

Comments
 (0)