Skip to content

fix: image

fix: image #23

Workflow file for this run

on:
push:
branches: [main]
tags: [v*]
workflow_dispatch:
jobs:
release:
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-substituters = https://cache.garnix.io
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: |
nix develop -c just build
nix develop -c just build-fr
- name: Publish Timestamped Pre-Release
if: github.ref == 'refs/heads/main'
run: |
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
gh release create "pre-$(date -u +%Y-%m-%dT%H-%M-%S)" *.json \
--prerelease --title "$NOW" --notes "Automated Pre-Release for $NOW"
- name: Publish Semantically Versionned Release
if: startsWith(github.ref, 'refs/tags/v')
run: |
TAG=${GITHUB_REF#refs/tags/}
gh release create "$TAG" *.json --title "$TAG" --notes "Release $TAG"
pages:
if: github.ref == 'refs/heads/main'
timeout-minutes: 5
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
extra-substituters = https://cache.garnix.io
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: nix develop -c just dist
- uses: actions/upload-pages-artifact@v4
with: { path: ./dist }
- uses: actions/deploy-pages@v4
id: deployment
cleanup:
if: github.ref == 'refs/heads/main'
timeout-minutes: 5
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- run: | # Cleanup rolling releases > 7 days or < 12 hours
gh release list --json tagName,createdAt,isPrerelease \
--jq '.[]|select(.isPrerelease == true)|"\(.tagName) \(.createdAt)"' \
| while read -r OLD_TAG CREATED_AT; do
TIMESTAMP=$(date -d "$CREATED_AT" +%s)
if [ "$TIMESTAMP" -lt "$(date -d '7 days ago' +%s)" ] || {
[ "$TIMESTAMP" -gt "$(date -d '12 hours ago' +%s)" ] &&
[ "$TIMESTAMP" -lt "$(date -d '10 minutes ago' +%s)" ]; }; then
gh release delete "$OLD_TAG" --yes --cleanup-tag
fi
done