Add git tagging workflow (#75) #1
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: "Git tag" | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
tag: | |
name: Push git tag for new release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Determine version | |
id: extract_version | |
run: | | |
VERSION=$(cat crates/air/Cargo.toml | grep '^version' | sed -e "s/[^.0-9]//g") | |
echo "air version: ${VERSION}" | |
echo "result=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Check for existing tag | |
id: check_tag | |
uses: mukunku/[email protected] | |
with: | |
tag: ${{ steps.extract_version.outputs.result }} | |
- name: Push tag | |
if: ${{ steps.check_tag.outputs.exists == 'false' }} | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.extract_version.outputs.result }} | |
tag_prefix: '' |