Skip to content

Build

Build #265

Workflow file for this run

name: Build
permissions:
contents: write
on:
schedule:
- cron: 0 4 * * * # 4:00 UTC everyday
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: setup Python with uv
id: setup-uv
uses: astral-sh/setup-uv@v5
with:
version: latest
python-version: ${{ matrix.python-version }}
enable-cache: true
prune-cache: false # do not remove pre-built wheels
ignore-nothing-to-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: hint on cache hit
if: steps.setup-uv.outputs.cache-hit == 'true'
run: echo "Hit cache"
- run: uv run cngal_calendar.py
- name: check release changes
id: check_changes
run: if [[ $(git diff --name-only HEAD) == *"output/cngal-release.txt"* ]]; then echo "changes=true" > "$GITHUB_OUTPUT"; else echo "changes=false" > "$GITHUB_OUTPUT"; fi
- name: commit files only if new release is available
if: ${{ steps.check_changes.outputs.changes == 'true' }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "ics: update release calendar" -a
- name: push changes
if: ${{ steps.check_changes.outputs.changes == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main