name: "Tag"
on:
push:
branches:
- "master"
permissions:
contents: write
jobs:
create-tag:
name: "Create git tag"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
with:
token: ${{ secrets.G_TOKEN }}
- name: "Get tag from Cargo.toml"
id: "get-tag"
shell: "bash"
run: |
echo PKG_VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml) >> $GITHUB_OUTPUT
- name: "Set git tag"
shell: "bash"
run: |
git tag v${{ steps.get-tag.outputs.PKG_VERSION }} && git push --tags