Files
bottom/.github/workflows/post_release.yml
T
Clement Tsang bb741a81da ci: run zizmor on GHA workflows (#2201)
Use zizmor to protect our workflows a bit better. Done buy running zizmor ./ --fix=unsafe-only.

We should also probably add zizmor to our CI pipeline.
2026-08-17 23:19:42 -04:00

101 lines
3.0 KiB
YAML

# Actions to run after releasing a version, like:
# - Generating documentation via mkdocs
# - Notifying packaging repos
name: post-release
on:
release:
types: [released]
workflow_dispatch:
inputs:
tag:
description: "Which tag to deploy as:"
required: true
permissions: {}
env:
# Assign commit authorship to official GitHub Actions bot when pushing to the `gh-pages` branch:
GIT_USER: "github-actions[bot]"
GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
jobs:
initialize:
name: initialize
runs-on: ubuntu-24.04
outputs:
version: ${{ env.VERSION }}
steps:
- name: Get the release version from the tag
run: |
if [[ -n "${GITHUB_EVENT_INPUTS_TAG}" ]]; then
echo "Manual run against a tag; overriding actual tag in the environment..."
echo "VERSION=${GITHUB_EVENT_INPUTS_TAG}" >> "$GITHUB_ENV"
else
echo "VERSION=${GITHUB_EVENT_RELEASE_TAG_NAME}" >> "$GITHUB_ENV"
fi
env:
GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }}
GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
- name: Make sure you're not on master/main/nightly
run: |
echo ${VERSION}
if [[ ${VERSION} == "master" || ${VERSION} == "main" || ${VERSION} == "nightly" ]]; then
exit 1
fi
docs:
needs: [initialize]
permissions:
pages: write
id-token: write
contents: write
uses: ./.github/workflows/docs.yml
secrets: inherit
with:
version: ${{ needs.initialize.outputs.version }}
alias: "stable"
chocolatey:
needs: [initialize]
runs-on: ubuntu-24.04
steps:
- name: Set release version
shell: bash
run: |
echo "RELEASE_VERSION=${NEEDS_INITIALIZE_OUTPUTS_VERSION}" >> $GITHUB_ENV
env:
NEEDS_INITIALIZE_OUTPUTS_VERSION: ${{ needs.initialize.outputs.version }}
- name: Validate release version
run: |
echo "Release version: ${RELEASE_VERSION}"
- name: Trigger choco
run: |
curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
publish-crate:
needs: [initialize, chocolatey, docs]
runs-on: ubuntu-24.04
environment: production
permissions:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
id: auth
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}