Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions .github/workflows/release-server-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ on:
version:
description: "Release version, for example 0.2.0 or v0.2.0"
required: true
publish:
description: "Publish assembled assets to a GitHub Release"
required: false
type: boolean
default: false
push:
tags:
- "v*"

permissions:
contents: write
contents: read

concurrency:
group: release-ripr-server-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
Expand Down Expand Up @@ -44,6 +53,8 @@ jobs:

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -53,19 +64,25 @@ jobs:
run: cargo build -p ripr --release --target ${{ matrix.target }}

- name: Package server archive
run: cargo xtask release-server-archive --version "${{ github.event.inputs.version || github.ref_name }}" --target "${{ matrix.target }}" --executable "${{ matrix.executable }}" --archive "${{ matrix.archive }}"
env:
RELEASE_VERSION: ${{ inputs.version || github.ref_name }}
run: cargo xtask release-server-archive --version "$RELEASE_VERSION" --target "${{ matrix.target }}" --executable "${{ matrix.executable }}" --archive "${{ matrix.archive }}"

- name: Upload server artifact
uses: actions/upload-artifact@v7
with:
name: ripr-server-${{ matrix.target }}
path: dist/*
retention-days: 7

manifest:
name: assemble release assets
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable

Expand All @@ -76,10 +93,40 @@ jobs:
merge-multiple: true

- name: Generate manifest and checksums
run: cargo xtask release-server-manifest --version "${{ github.event.inputs.version || github.ref_name }}" --repository "${{ github.repository }}"
env:
RELEASE_VERSION: ${{ inputs.version || github.ref_name }}
RELEASE_REPOSITORY: ${{ github.repository }}
run: cargo xtask release-server-manifest --version "$RELEASE_VERSION" --repository "$RELEASE_REPOSITORY"

- name: Upload assembled release assets
uses: actions/upload-artifact@v7
with:
name: ripr-server-release-assets
path: dist/*
retention-days: 7

publish:
name: publish GitHub Release assets
if: ${{ github.event_name == 'push' || inputs.publish }}
needs: manifest
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable

- uses: actions/download-artifact@v8
with:
name: ripr-server-release-assets
path: dist

- name: Upload release assets
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: cargo xtask release-upload-assets --version "${{ github.event.inputs.version || github.ref_name }}"
RELEASE_VERSION: ${{ inputs.version || github.ref_name }}
run: cargo xtask release-upload-assets --version "$RELEASE_VERSION"
25 changes: 21 additions & 4 deletions docs/RELEASE_BINARIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,30 @@ Use:
.github/workflows/release-server-binaries.yml
```

Manual dispatch:
A manual dispatch is a **no-publish rehearsal by default**:

```bash
gh workflow run release-server-binaries.yml -f version=0.8.0
gh workflow run release-server-binaries.yml \
-f version=0.8.0 \
-f publish=false
```

That path builds every target, assembles the manifest and `SHA256SUMS`, and
retains the complete release-asset set as a workflow artifact. It does not create
or modify a GitHub Release.

Publication from a manual dispatch is an explicit operator action:

```bash
gh workflow run release-server-binaries.yml \
-f version=0.8.0 \
-f publish=true
```

Use `publish=true` only after reviewing the rehearsal artifacts and confirming
the intended release authority. A `v*` tag push remains the automatic publish
path.

The workflow builds:

```text
Expand All @@ -27,7 +45,6 @@ x86_64-unknown-linux-gnu
aarch64-unknown-linux-gnu
```


Packaging and manifest assembly intentionally live in Rust-first automation:

```bash
Expand All @@ -39,7 +56,7 @@ cargo xtask release-upload-assets --version <VERSION>
The workflow should only orchestrate those commands instead of keeping archive,
checksum, manifest, or upload branching logic in shell or PowerShell.

and uploads these assets to the matching GitHub Release:
The assembled asset set is:

```text
ripr-server-v<VERSION>-<target>.zip
Expand Down
Loading