diff --git a/.github/workflows/tagging.yaml b/.github/workflows/tagging.yaml new file mode 100644 index 0000000..e5ccf61 --- /dev/null +++ b/.github/workflows/tagging.yaml @@ -0,0 +1,53 @@ +name: Tagging Workflow + +on: + push: + branches: + - mpx + paths-ignore: + - '.github/**' + +permissions: + contents: write + +jobs: + tag: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Ensures that all tags are downloaded + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install GitPython + curl -o tagit.py https://raw.githubusercontent.com/dbt1/tagit/master/tagit.py + chmod +x tagit.py + + - name: Verify tagit.py download + run: | + if [ ! -f tagit.py ]; then + echo "tagit.py was not downloaded!" + exit 1 + fi + + - name: Tagging + run: | + python tagit.py -f configure.ac + + - name: Commit and push changes + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git add configure.ac + git commit -m "tagging: Automatically updated tags [skip ci]" || echo "No changes to commit" + git push + git push --tags