Release #43
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
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The version to release" | |
required: true | |
name: Release | |
concurrency: | |
group: release | |
cancel-in-progress: false | |
jobs: | |
release: | |
name: Generate Github release and tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Write version | |
run: | | |
sed -i -E 's/^version = .*/version = "${{ github.event.inputs.version }}"/g' Cargo.toml | |
sed -i -E "$(( 1 + $(grep --line-number 'template-cli' Cargo.lock | cut -f1 -d:) ))"'s/^version = .*/version = "${{ github.event.inputs.version }}"/g' Cargo.lock | |
sed -i -E 's/r#"template-cli .*/r#"template-cli ${{ github.event.inputs.version }}/g' tests/integration_tests.rs | |
- name: Commit new version | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
git add Cargo.toml Cargo.lock tests/integration_tests.rs | |
git commit --message "Version ${{ github.event.inputs.version }}" | |
git push | |
git tag --annotate --message 'Version ${{ github.event.inputs.version }}' "v${{ github.event.inputs.version }}" | |
git push origin "v${{ github.event.inputs.version }}" | |
- name: Trigger publish | |
run: gh workflow run publish.yml --ref "refs/tags/v${{ github.event.inputs.version }}" | |
env: | |
GH_TOKEN: ${{ github.token }} |