Add GitHub Actions workflow for automatic tagging #1
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: 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 "[email protected]" | |
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 |