mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-27 19:57:02 +00:00
.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 https://github.com/pybricks/support/issues/1558
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v3.*'
|
||||
|
||||
name: Create release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
upload_release:
|
||||
name: Upload Release Assets
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Create release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [[ "${{ contains(env.GITHUB_TAG, 'a') || contains(env.GITHUB_TAG, 'b') || contains(env.GITHUB_TAG, 'c') }}" == "true" ]]; then
|
||||
PRERELEASE_FLAG="--prerelease"
|
||||
else
|
||||
PRERELEASE_FLAG=""
|
||||
fi
|
||||
gh release create "$tag" \
|
||||
--repo="$GITHUB_REPOSITORY" \
|
||||
--title="${tag#v}" \
|
||||
-F CHANGELOG.md \
|
||||
$PRERELEASE_FLAG
|
||||
Reference in New Issue
Block a user