From ae235cf1a3038f7c90f24562d1dfa6698a443ac7 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 31 Aug 2023 18:22:55 +0200 Subject: [PATCH] Add workflow to create tags for versions --- .github/workflows/tag.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..0209f7be --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,31 @@ +name: test + +on: + # Update tags on every push to main. + push: + branches: + - main + + # To allow for manual testing. + workflow_dispatch: + +jobs: + tag: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-tags: true + + - shell: bash + run: | + set -ex + commits=$(git log --pretty=format:"%h" ./VERSION) + for commit in $commits; do + version=$(git show $commit:./VERSION) + git tag "v${version}" $commit + done + + - shell: bash + run: git push --tags