name: Release # Triggered by the version-x.y.z tag that `make jjrelease` pushes. The workflow publishes the crate to # the private registry, updates the wiki, then creates the Forgejo release with the tag notes. # Each step is replayable: rerunning the workflow after a failure is safe. # # Repository secret: FORGETOKEN (Forgejo token with write rights on the packages, # the repository, the wiki and the releases). on: push: tags: - "version-*" jobs: release: runs-on: ubuntu-latest timeout-minutes: 30 env: FORGETOKEN: ${{ secrets.FORGETOKEN }} TAG: ${{ github.ref_name }} SERVER: ${{ github.server_url }} REPO: ${{ github.repository }} WIKI_TOKEN: ${{ secrets.FORGETOKEN }} steps: - name: System tools run: | apt-get update -qq apt-get install -y -qq git curl jq make build-essential pkg-config - name: Version sources run: | git -c http.extraHeader="Authorization: token $FORGETOKEN" \ clone --depth 1 --branch "$TAG" "$SERVER/$REPO.git" src - name: Rust run: | curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable . "$HOME/.cargo/env" cargo install cargo-doc-md --locked - name: Publish to the private registry working-directory: src run: | . "$HOME/.cargo/env" make publish - name: Update the wiki working-directory: src run: | . "$HOME/.cargo/env" make wiki - name: Create the Forgejo release working-directory: src run: .crate-kit/scripts/forgejo-release.sh