Skip to content

Commit

Permalink
Add git tagging workflow (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan authored Nov 27, 2024
1 parent 003c31b commit 4f77c11
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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: ''

0 comments on commit 4f77c11

Please sign in to comment.