WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Generate release schedule artifacts #4

Generate release schedule artifacts

Generate release schedule artifacts #4

name: Generate release schedule artifacts
on:
schedule:
# At 00:00 on day-of-month 2 in every 3rd month. (i.e. every quarter)
# 2nd is chosen to avoid fencepost errors
- cron: "0 0 2 */3 *"
push:
branches:
- "main"
# On demand
workflow_dispatch:
jobs:
create-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
# We're going to make a tag that we can we release so we'll need the full history for that
fetch-depth: 0
- uses: prefix-dev/[email protected]
with:
pixi-version: "v0.49.0"
- name: Generate artifacts
run: |
pixi run generate-schedule --locked
- name: Test json artifact
run: |
cat schedule.json | jq
- name: setup git
run: |
# git will complain if we don't do this first
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: determine tag name
id: tag_name
run: |
echo "TAG_NAME=$(date '+%Y-Q%q')" >> "$GITHUB_OUTPUT"
- name: Commit artifacts and create tag
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: |
git add -f schedule.md chart.md schedule.json
git commit -m "generate schedule for ${{ steps.tag_name.outputs.TAG_NAME }} release" || echo "No changes to commit"
git tag ${{ steps.tag_name.outputs.TAG_NAME }}
git push origin main
git push origin tag ${{ steps.tag_name.outputs.TAG_NAME }}
- name: Publish github release
uses: softprops/action-gh-release@v2
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
with:
generate_release_notes: true
tag_name: ${{ steps.tag_name.outputs.TAG_NAME }}
make_latest: true
files: |
schedule.md
chart.md
schedule.json
permissions:
contents: write