Release #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Branch or tag ref to run the workflow on' | |
required: true | |
default: 'main' | |
version: | |
description: 'The version to release (e.g. 1.2.3). This workflow will automatically perform the required version bumps' | |
required: true | |
env: | |
RELEASE_VERSION: ${{ inputs.version }} | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
validate-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Validate tag does not exist on current commit | |
uses: ./.github/workflows/validate-tag | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
build: | |
needs: | |
- validate-tag | |
strategy: | |
matrix: | |
os: | |
- macos-14 | |
- macos-13 | |
- ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/workflows/env-setup | |
- name: Build | |
run: poetry run poe build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: terranova-${{ matrix.os }} | |
path: 'dist/*' | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Create the release tag | |
run: | | |
git tag "${RELEASE_VERSION}" | |
git push origin "${RELEASE_VERSION}" | |
- name: Create the release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh release create --generate-notes --latest --title="terranova v${RELEASE_VERSION}" "${RELEASE_VERSION}" ./terranova-* |