Skip to content

Follow latest

Follow latest #213

Workflow file for this run

name: Follow latest
on:
workflow_dispatch:
push:
branches: [main]
schedule:
- cron: 0 0 * * *
jobs:
follow-latest:
runs-on: ubuntu-22.04
strategy:
max-parallel: 1
matrix:
branch: [main, develop]
outputs:
version: ${{ steps.version.outputs.version }}
changes-detected: ${{ steps.auto-commit.outputs.changes_detected }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branch }}
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: git fetch origin main
- run: git checkout origin/main .github
- run: pip install -r .github/scripts/requirements.txt
- run: rm -rf *
- run: .github/scripts/main.py ${{ matrix.branch }}
- name: Get version
run: echo "version=v$(grep -m1 ARGYLL_VERSION_STR h/aconfig.h | cut -d '"' -f2)" >> $GITHUB_OUTPUT
id: version
- run: git tag -d ${{ needs.follow-latest.outputs.version }}
- uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit
with:
commit_message: ${{ steps.version.outputs.version }}
tagging_message: ${{ steps.version.outputs.version }}
push_options: '--force'
follow-release:
runs-on: ubuntu-22.04
needs: follow-latest
if: github.ref == 'refs/heads/main' && needs.follow-latest.outputs.changes-detected == 'true'
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install -r .github/scripts/requirements.txt
- run: .github/scripts/release.py
- uses: softprops/action-gh-release@v1
with:
name: ${{ needs.follow-latest.outputs.version }}
tag_name: ${{ needs.follow-latest.outputs.version }}
files: Argyll_*