name: release
on:
push:
branches: [main, master, alpha, beta]
workflow_dispatch:
permissions: {}
jobs:
build:
uses: ./.github/workflows/build.yml
if: "${{ ! startsWith(github.event.head_commit.message, 'chore(release): ') }}"
permissions:
contents: read
get-version-metadata:
runs-on: ubuntu-24.04
needs: build
if: "${{ ! startsWith(github.event.head_commit.message, 'chore(release): ') }}"
permissions:
contents: read
outputs:
version-metadata: ${{ steps.get-version-metadata.outputs.version-metadata }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
fetch-depth: 0
fetch-tags: true
submodules: recursive
- id: get-version-metadata
run: |
classicube_version="$(git -C ./ClassiCube/ describe --exact-match --tags HEAD)"
test -z "$classicube_version" && echo "classicube_version is empty" && exit 1
version_metadata="ClassiCube $classicube_version"
echo "version-metadata=$version_metadata" | tee -a "$GITHUB_OUTPUT"
release:
uses: SpiralP/github-reusable-workflows/.github/workflows/release.yml@78cca1708ee40ff0f5cab7b971204653ddefcca0 needs: get-version-metadata
if: "${{ needs.get-version-metadata.outputs.version-metadata }}"
permissions: {} concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false with:
cargo-publish: true
environment-name: release
replace-files: |
Cargo.lock
Cargo.toml
package-name: classicube-sys
version-metadata: ${{ needs.get-version-metadata.outputs.version-metadata }}
build-workflow: build.yml
secrets:
app-client-id: ${{ secrets.APP_CLIENT_ID }}
app-private-key: ${{ secrets.APP_PRIVATE_KEY }}
cargo-registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
deploy-docs:
name: Deploy docs to Pages
needs: release
if: ${{ needs.release.outputs.tag && !contains(needs.release.outputs.tag, '-') }}
runs-on: ubuntu-24.04
permissions:
contents: read
actions: read pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page-url }}
concurrency:
group: pages
cancel-in-progress: false
steps:
- id: deploy
uses: SpiralP/github-reusable-workflows/.github/actions/deploy-pages-from-run@78cca1708ee40ff0f5cab7b971204653ddefcca0 with:
run-id: ${{ needs.release.outputs.dispatched-run-id }}