Merge pull request #110 from nanox333/codex/release-contributor-refresh

Release: refresh contributor credits automatically before builds
This commit is contained in:
Dylan M. Taylor authored and GitHub committed 2026-11-01 01:00:55 -04:00
commit 2ce6aa59c7
5 files changed
+335

No files matched your search

@@ -0,0 +1,50 @@
name: Refresh release contributors
on:
workflow_call:
outputs:
artifact-name:
description: Contributor snapshot to pass to the release workflow
value: ${{ jobs.refresh.outputs.artifact-name }}
permissions:
contents: read
pull-requests: read
jobs:
refresh:
runs-on: ubuntu-24.04
timeout-minutes: 15
outputs:
artifact-name: contributor-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Refresh contributor credits for this release commit
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
python3 scripts/refresh-contributors.py --repo "$GITHUB_REPOSITORY"
python3 - <<'PY'
import json
import os
from pathlib import Path
credits = json.loads(Path("contributors/contributors.json").read_text())
if credits.get("head") != os.environ["GITHUB_SHA"]:
raise SystemExit("Contributor snapshot does not match the release commit")
if credits.get("repo") != os.environ["GITHUB_REPOSITORY"]:
raise SystemExit("Contributor snapshot does not match the release repository")
if not credits.get("contributors"):
raise SystemExit("Contributor snapshot is empty")
PY
- name: Save the refreshed snapshot for all release builds
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: contributor-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
path: contributors/contributors.json
if-no-files-found: error
retention-days: 7
+47
View File
@@ -27,6 +27,11 @@ on:
type: string
required: false
default: ""
contributors-artifact:
description: "Optional contributor snapshot artifact from refresh-contributors.yml in this workflow run; installed before every source build"
type: string
required: false
default: ""
has-web:
description: "Whether to build the WebAssembly (wasm) release"
type: boolean
@@ -264,6 +269,12 @@ jobs:
exit 1
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-fonts
if: inputs.craft-fonts-ref != ''
uses: storytold/craft-common-actions/actions/checkout-craft-fonts@main
@@ -414,6 +425,12 @@ jobs:
exit 1
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-fonts
if: inputs.craft-fonts-ref != ''
uses: storytold/craft-common-actions/actions/checkout-craft-fonts@main
@@ -519,6 +536,12 @@ jobs:
INPUT_VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-fonts
if: inputs.craft-fonts-ref != ''
uses: storytold/craft-common-actions/actions/checkout-craft-fonts@main
@@ -798,6 +821,12 @@ jobs:
;;
esac
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-fonts
if: inputs.craft-fonts-ref != ''
uses: storytold/craft-common-actions/actions/checkout-craft-fonts@main
@@ -1041,6 +1070,12 @@ jobs:
INPUT_VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: stable
@@ -1139,6 +1174,12 @@ jobs:
INPUT_VERSION: ${{ inputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-fonts
if: inputs.craft-fonts-ref != ''
uses: storytold/craft-common-actions/actions/checkout-craft-fonts@main
@@ -1210,6 +1251,12 @@ jobs:
FIGCRAFT_BUILD_SHA: ${{ github.sha }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Load refreshed contributor credits
if: inputs.contributors-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.contributors-artifact }}
path: contributors
- name: Check out craft-i18n
uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
+2
View File
@@ -5,6 +5,7 @@ on:
paths:
- .github/workflows/freebsd.yml
- .github/workflows/release.yml
- .github/workflows/refresh-contributors.yml
- .github/workflows/gate.yml
- actions/freebsd-cargo-cache/**
- actions/checkout-craft-i18n/**
@@ -17,6 +18,7 @@ on:
paths:
- .github/workflows/freebsd.yml
- .github/workflows/release.yml
- .github/workflows/refresh-contributors.yml
- .github/workflows/gate.yml
- actions/freebsd-cargo-cache/**
- actions/checkout-craft-i18n/**