Initial commit

This commit is contained in:
Graham Christensen 2025-05-14 17:20:48 -04:00
parent 681714470d
commit fbd616d075
15 changed files with 800 additions and 0 deletions

29
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,29 @@
on:
pull_request:
push:
branches: [main]
jobs:
lints:
name: Build
runs-on: ubuntu-latest
permissions:
id-token: "write"
contents: "read"
steps:
- uses: actions/checkout@v4
- uses: ./.
- run: nix develop -c typos
if: success() || failure()
- run: nix develop -c ruff check
if: success() || failure()
- run: nix develop -c ruff format --diff
if: success() || failure()
- run: nix develop -c shellcheck ./tools/*.sh
if: success() || failure()
- name: Regenerate the README to make sure it is unchanged
run: nix develop -c ./tools/generate.sh
if: success() || failure()
- name: Assert no changes were made
run: git diff --exit-code
if: success() || failure()

34
.github/workflows/propose-release.yml vendored Normal file
View file

@ -0,0 +1,34 @@
on:
workflow_dispatch:
inputs:
reference-id:
type: string
required: true
version:
type: string
required: true
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
propose-release:
uses: DeterminateSystems/propose-release/.github/workflows/workflow.yml@main
permissions:
id-token: "write"
contents: "write"
pull-requests: write
with:
reference-id: ${{ inputs.reference-id }}
version: ${{ inputs.version }}
extra-commands-early: |
nix develop -c ./tools/update-state.sh "v$VERSION"
git diff || true
git add tools/state.json
git commit -m "Update the state.json for v$VERSION"
nix develop -c ./tools/generate.sh
git add README.md action.yml
git commit -m "Update README.md and action.yml for v$VERSION"
echo "Checking there is no remaining diff..."
git diff --exit-code

34
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,34 @@
on:
release:
types:
- released
jobs:
PushLooseTag:
environment: production
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Optionally tag a vMAJOR tag
id: check_tag
env:
VERSION: ${{ github.ref_name }}
run: |
if ! echo "$VERSION" | grep -q "^v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+$"; then
echo "version needs to be a version, in x.y.z format."
echo "Therefore, not pushing a v<short>"
exit 0
fi
shorttag=$(echo "$VERSION" | cut -d'.' -f1)
echo "shorttag=$shorttag" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- name: Create the short tag
env:
SHORTTAG: ${{ steps.check_tag.outputs.shorttag }}
run: |
git tag --force "$SHORTTAG"
git push --force origin "$SHORTTAG"