Trigger an update #18
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: Trigger an update | |
on: | |
workflow_dispatch: | |
inputs: | |
commit_message: | |
description: "Reason for rebuild (commit message)" | |
required: true | |
jobs: | |
trigger: | |
name: Update BUILD-DATA | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Update file | |
run: | | |
python -c "num = int(open('BUILD-DATA', 'r').read().strip().split(':')[1].strip()); open('BUILD-DATA', 'w').write('build-number: {0}{1}'.format(num + 1, chr(0x0a)))" | |
- name: Push to GitHub | |
run: | | |
git config --global user.name '${{ github.actor }} (via bot)' | |
git config --global user.email '[email protected]' | |
git config --global push.default 'simple' | |
git checkout master | |
git remote rm origin | |
git remote add origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" | |
git status | |
git add . | |
git status | |
git commit -am "${{ github.event.inputs.commit_message }}" | |
git push origin master | |
baseline: | |
name: Nikola baseline site build (Python ${{ matrix.python }} on ${{ matrix.image }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ['3.12'] | |
image: | |
- ubuntu-latest | |
runs-on: '${{ matrix.image }}' | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '${{ matrix.python }}' | |
- name: Clone Nikola | |
run: | | |
git clone https://github.com/getnikola/nikola.git | |
- name: Upgrade packaging stack | |
run: | | |
pip install --upgrade-strategy eager -U pip setuptools wheel | |
- name: Install requirements | |
run: | | |
pip install --upgrade-strategy eager -Ur requirements-extras.txt freezegun | |
working-directory: nikola | |
- name: Install Nikola | |
run: | | |
pip install . | |
working-directory: nikola | |
- name: Build baseline site | |
run: | | |
scripts/baseline.sh build | |
working-directory: nikola | |
- name: Push to GitHub | |
run: | | |
git config --global user.name 'Invariant Builds Action' | |
git config --global user.email '[email protected]' | |
git config --global push.default 'simple' | |
git init . | |
git checkout -b $(../../scripts/getpyver.py) | |
git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | |
git add . | |
git commit -am "invariant build $(date)" | |
git push --force origin $(../../scripts/getpyver.py) | |
working-directory: nikola/nikola-baseline-build/output |