Upgrade to clap 4. #9
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: Add Tag | |
on: | |
push: | |
branches: [ main ] | |
paths: [ "Cargo.toml" ] | |
workflow_dispatch: {} | |
jobs: | |
tag: | |
name: Define Tags for version in Cargo.toml | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Tag | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
TAG=v$(cargo metadata --no-deps --quiet | jq -r '.packages[0] | .version') | |
git fetch --tags | |
if [ $(git tag -l $TAG) ] | |
then | |
echo "Git tag $TAG already exists." | |
else | |
git config user.name "Add Tag from CI" | |
git config user.email "" | |
git tag $TAG | |
git push --tags | |
fi | |
gh release view $TAG &> /dev/null || gh release create $TAG -d --notes $TAG |