Skip to content

Commit 338cb06

Browse files
fix: implement complete release system with release-plz (#209)
* chore: remove all release infrastructure Complete removal of release tooling including: - release-plz configuration - cargo-dist configuration - cliff changelog generator - GitHub Actions workflows for releases - Debug release scripts Starting fresh to properly configure release automation * chore: remove tag-on-merge workflow Part of complete release infrastructure removal * chore: complete removal of all release infrastructure - Remove docker-publish workflow that triggered on releases - Remove old release process documentation - Clean slate for new release system * feat: implement complete release system with release-plz - Configure workspace versioning (all crates share same version) - Add release-plz.toml with single tag format (v{version}) - Add cliff.toml for changelog generation - Add GitHub workflows for release-plz and Docker builds - Initialize cargo-dist for binary distribution - Create multi-stage Dockerfile with Alpine Release flow: 1. Push to main triggers release-plz to create PR 2. PR contains version bumps for all crates 3. Merge creates single tag (v0.x.x format) 4. Tag triggers cargo-dist for binaries and Docker builds 5. All three crates publish to crates.io * chore: remove duplicate Dockerfile.alpine * fix: improve release-plz configuration - Add version_group to ensure all packages share same version - Add explicit git_tag_enable = true - Add semver_check for breaking change detection - Add pr_labels for release PRs - Add publish_timeout and other best practices from real-world usage * fix: update release-plz action to latest version v0.5.114 Pin to specific version for reproducible builds * fix: use floating v0.5 tag for release-plz action Following pattern used by octocrab and other successful projects. The docs appear to be incorrect about release-plz/release-plz.
1 parent 1a74f31 commit 338cb06

File tree

18 files changed

+137
-1180
lines changed

18 files changed

+137
-1180
lines changed

.github/workflows/docker-publish.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

.github/workflows/docker.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
name: Docker Build and Push
1+
name: Docker Build
22

33
on:
4-
workflow_dispatch:
54
push:
65
tags:
7-
- 'v*'
8-
release:
9-
types: [published]
6+
- "v*"
107

118
env:
129
REGISTRY: docker.io
1310
IMAGE_NAME: joshrotenberg/redisctl
1411

1512
jobs:
1613
docker:
14+
name: Build and Push Docker Images
1715
runs-on: ubuntu-latest
1816
permissions:
1917
contents: read
2018
packages: write
21-
2219
steps:
2320
- name: Checkout repository
2421
uses: actions/checkout@v4
2522

23+
- name: Extract version
24+
id: version
25+
run: |
26+
VERSION=${GITHUB_REF#refs/tags/v}
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
29+
echo "minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
30+
2631
- name: Set up QEMU
2732
uses: docker/setup-qemu-action@v3
2833

@@ -32,34 +37,29 @@ jobs:
3237
- name: Log in to Docker Hub
3338
uses: docker/login-action@v3
3439
with:
35-
registry: ${{ env.REGISTRY }}
36-
username: ${{ secrets.DOCKER_USERNAME }}
37-
password: ${{ secrets.DOCKER_PASSWORD }}
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
3842

39-
- name: Extract metadata
40-
id: meta
41-
uses: docker/metadata-action@v5
43+
- name: Log in to GHCR
44+
uses: docker/login-action@v3
4245
with:
43-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44-
tags: |
45-
type=ref,event=branch
46-
type=ref,event=pr
47-
type=semver,pattern={{version}}
48-
type=semver,pattern={{major}}.{{minor}}
49-
type=semver,pattern={{major}}
50-
type=sha
51-
type=raw,value=latest,enable={{is_default_branch}}
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
5249

5350
- name: Build and push Docker image
5451
uses: docker/build-push-action@v5
5552
with:
5653
context: .
57-
file: ./Dockerfile.alpine
54+
file: ./Dockerfile
5855
platforms: linux/amd64,linux/arm64
5956
push: true
60-
tags: ${{ steps.meta.outputs.tags }}
61-
labels: ${{ steps.meta.outputs.labels }}
57+
tags: |
58+
${{ env.IMAGE_NAME }}:latest
59+
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
60+
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.minor }}
61+
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.major }}
62+
ghcr.io/${{ env.IMAGE_NAME }}:latest
63+
ghcr.io/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
6264
cache-from: type=gha
6365
cache-to: type=gha,mode=max
64-
build-args: |
65-
VERSION=${{ github.ref_name }}

.github/workflows/prepare-release.yml

Lines changed: 0 additions & 132 deletions
This file was deleted.

.github/workflows/release-plz.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-plz:
14+
name: Release-plz
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Run release-plz
27+
uses: MarcoIeni/[email protected]
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
pull_request:
4343
push:
4444
tags:
45-
- 'redisctl-v*'
45+
- '**[0-9]+.[0-9]+.[0-9]+*'
4646

4747
jobs:
4848
# Run 'dist plan' (or host) to determine what tasks we need to do

.github/workflows/tag-on-merge.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)