Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git tagging workflow #75

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: ''