Skip to content

chore: update version strings #55

chore: update version strings

chore: update version strings #55

Workflow file for this run

# This workflow runs when a version tag is pushed.
#
# - Get new tag.
# - If release condidate tag:
# - Build the pre-release.
# - Cut GitHub pre-release.
# - Upload wheel to pre-release.
name: Prerelease Tag Workflow
on:
push:
tags:
- 'v*'
jobs:
cut_prerelease:
name: Cut Pre-Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
- name: Get new tag
id: newversion
run: |
tag=${GITHUB_REF/refs\/tags\//}
if [[ $tag == *"-rc"* ]]; then
echo "do_prerelease=1" >> $GITHUB_ENV
fi
echo "tag=$(echo $tag)" >> $GITHUB_OUTPUT
echo "New tag is: $tag"
echo "GitHub ref: ${{ github.ref }}"
- name: Build pre-release
id: build
if: ${{ env.do_prerelease == 1 }}
run: |
pip install -U pip poetry twine
poetry build && twine check dist/* && echo "build_ok=1" >> $GITHUB_ENV
- name: Cut pre-release
id: cutprerelease
if: ${{ env.build_ok == 1 }}
uses: release-drafter/release-drafter@v5
with:
name: ${{ env.tag }}
tag: ${{ env.tag }}
version: ${{ env.tag }}
prerelease: true
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload wheel to GitHub pre-release
id: upload-wheel
if: ${{ env.build_ok == 1 }}
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.cutprerelease.outputs.upload_url }}
asset_path: ./dist/*.whl