name: release
on:
workflow_dispatch:
inputs:
releaseKind:
description: "Kind of release"
default: "minor"
type: choice
options:
- patch
- minor
required: true
jobs:
rust:
name: release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- uses: denoland/setup-deno@v2
- uses: dsherret/rust-toolchain-file@v1
- name: Check release token
env:
GH_TOKEN: ${{ secrets.DENOBOT_PAT }}
run: |
if [ -z "$GH_TOKEN" ]; then
echo "DENOBOT_PAT is required to push release tags and trigger publish workflows." >&2
exit 1
fi
if ! gh api user --jq .login >/dev/null; then
echo "DENOBOT_PAT is invalid or expired. Rotate it before running release again." >&2
exit 1
fi
- name: Tag and release
env:
GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }}
GH_WORKFLOW_ACTOR: ${{ github.actor }}
run: |
git config user.email "denobot@users.noreply.github.com"
git config user.name "denobot"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
deno run -A jsr:@deno/rust-automation@0.22.1/tasks/publish-release --${{github.event.inputs.releaseKind}} deno_doc