Followup to the 0.5.0 release (#76)

* Document RELEASING.md process
* Bump version numbers
* Do not automatically produce GH releases, and do not build binaries to attach to them
* Only build docker images on tags
* Use the `latest` Docker image tag in the Docker-compose config
This commit is contained in:
Dustin J. Mitchell 2024-12-15 22:51:57 -05:00 committed by GitHub
parent a364791fcc
commit 65a3d806d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 36 additions and 71 deletions

View file

@ -1,58 +0,0 @@
name: Build
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
target:
- tag: amd64-musl
target: x86_64-unknown-linux-musl
- tag: amd64-glibc
target: x86_64-unknown-linux-gnu
name: Build TaskChampion Sync-Server ${{ matrix.target.tag }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
targets: ${{ matrix.target.target }}
- name: Build
run: |
[ "${{ matrix.target.target }}" == "x86_64-unknown-linux-musl" ] && sudo apt update && sudo apt -y install musl-tools
cargo build --target ${{ matrix.target.target }} --release --locked
- name: Package current compilation
id: package-current
run: |
install -Dm755 "target/${{ matrix.target.target }}/release/taskchampion-sync-server" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}-${GITHUB_SHA}/taskchampion-sync-server"
install -Dm644 "README.md" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}-${GITHUB_SHA}/README.md"
install -Dm644 "LICENSE" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}-${GITHUB_SHA}/LICENSE"
echo "version=${GITHUB_REF##*/}-${GITHUB_SHA}" >> $GITHUB_OUTPUT
- name: Archive current compilation
uses: actions/upload-artifact@v4
with:
name: "taskchampion-sync-server-${{ matrix.target.tag }}-${{ steps.package-current.outputs.version }}"
path: "taskchampion-sync-server-${{ matrix.target.tag }}-${{ steps.package-current.outputs.version }}/"
- name: Package tagged compilation
id: package
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
run: |
install -Dm755 "target/${{ matrix.target.target }}/release/taskchampion-sync-server" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}/taskchampion-sync-server"
install -Dm644 "README.md" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}/README.md"
install -Dm644 "LICENSE" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}/LICENSE"
tar cvJf "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}.tar.xz" "taskchampion-sync-server-${{ matrix.target.tag }}-${GITHUB_REF##*/}"
echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
files: "taskchampion-sync-server-${{ matrix.target.tag }}-${{ steps.package.outputs.version }}.tar.xz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -2,8 +2,6 @@ name: Build Docker
on: on:
push: push:
branches:
- '*'
tags: tags:
- '*' - '*'

6
Cargo.lock generated
View file

@ -1558,7 +1558,7 @@ dependencies = [
[[package]] [[package]]
name = "taskchampion-sync-server" name = "taskchampion-sync-server"
version = "0.4.1" version = "0.5.1-pre"
dependencies = [ dependencies = [
"actix-rt", "actix-rt",
"actix-web", "actix-web",
@ -1580,7 +1580,7 @@ dependencies = [
[[package]] [[package]]
name = "taskchampion-sync-server-core" name = "taskchampion-sync-server-core"
version = "0.5.0-pre" version = "0.5.1-pre"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",
@ -1593,7 +1593,7 @@ dependencies = [
[[package]] [[package]]
name = "taskchampion-sync-server-storage-sqlite" name = "taskchampion-sync-server-storage-sqlite"
version = "0.5.0-pre" version = "0.5.1-pre"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",

View file

@ -27,6 +27,11 @@ use a reverse proxy such as Nginx, haproxy, or Apache httpd.
### Using Docker-Compose ### Using Docker-Compose
Every release of the server generates a Docker image in
`ghcr.io/gothenburgbitfactory/taskchampion-sync-server`. The tags include
`latest` for the latest release, and both minor and patch versions, e.g., `0.5`
and `0.5.1`.
The [`docker-compose.yml`](./docker-compose.yml) file in this repository is The [`docker-compose.yml`](./docker-compose.yml) file in this repository is
sufficient to run taskchampion-sync-server, including setting up TLS sufficient to run taskchampion-sync-server, including setting up TLS
certificates using Lets Encrypt, thanks to [Caddy](https://caddyserver.com/). certificates using Lets Encrypt, thanks to [Caddy](https://caddyserver.com/).
@ -44,9 +49,9 @@ TASKCHAMPION_SYNC_SERVER_HOSTNAME=taskwarrior.example.com docker compose up
``` ```
It can take a few minutes to obtain the certificate; the caddy container will It can take a few minutes to obtain the certificate; the caddy container will
log a msg "certificate obtained successfully" when this is complete, or error log a message "certificate obtained successfully" when this is complete, or
messages if the process fails. Once this process is complete, configure your error messages if the process fails. Once this process is complete, configure
`.taskrc`'s to point to the server: your `.taskrc`'s to point to the server:
``` ```
sync.server.url=https://taskwarrior.example.com sync.server.url=https://taskwarrior.example.com
@ -108,6 +113,7 @@ cargo build --release
After build the binary is located in After build the binary is located in
`target/release/taskchampion-sync-server`. `target/release/taskchampion-sync-server`.
### Building the Container ### Building the Container
To build the container execute the following commands. To build the container execute the following commands.

19
RELEASING.md Normal file
View file

@ -0,0 +1,19 @@
# Release process
1. Run `git pull upstream main`
1. Run `cargo test`
1. Run `cargo clean && cargo clippy`
1. Remove the `-pre` from `version` in all `*/Cargo.toml`, and from the `version = ..` in any references between packages.
1. Run `cargo semver-checks` (https://crates.io/crates/cargo-semver-checks)
1. Run `cargo build --release`
1. Commit the changes (Cargo.lock will change too) with comment `vX.Y.Z`.
1. Run `git tag vX.Y.Z`
1. Run `git push upstream`
1. Run `git push upstream --tag vX.Y.Z`
1. Run `cargo publish -p taskchampion-sync-server-core`
1. Run `cargo publish -p taskchampion-sync-server-storage-sqlite` (and add any other new published packages here)
1. Bump the patch version in `*/Cargo.toml` and add the `-pre` suffix. This allows `cargo-semver-checks` to check for changes not accounted for in the version delta.
1. Run `cargo build --release` again to update `Cargo.lock`
1. Commit that change with comment "Bump to -pre version".
1. Run `git push upstream`
1. Navigate to the tag in the GitHub releases UI and create a release with general comments about the changes in the release

View file

@ -1,6 +1,6 @@
[package] [package]
name = "taskchampion-sync-server-core" name = "taskchampion-sync-server-core"
version = "0.5.0-pre" version = "0.5.1-pre"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"] authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021" edition = "2021"
description = "Core of sync protocol for TaskChampion" description = "Core of sync protocol for TaskChampion"

View file

@ -46,7 +46,7 @@ services:
condition: service_completed_successfully condition: service_completed_successfully
tss: tss:
image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:main image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:latest
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- type: volume - type: volume

View file

@ -1,6 +1,6 @@
[package] [package]
name = "taskchampion-sync-server" name = "taskchampion-sync-server"
version = "0.4.1" version = "0.5.1-pre"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"] authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021" edition = "2021"
publish = false publish = false

View file

@ -1,13 +1,13 @@
[package] [package]
name = "taskchampion-sync-server-storage-sqlite" name = "taskchampion-sync-server-storage-sqlite"
version = "0.5.0-pre" version = "0.5.1-pre"
authors = ["Dustin J. Mitchell <dustin@mozilla.com>"] authors = ["Dustin J. Mitchell <dustin@mozilla.com>"]
edition = "2021" edition = "2021"
description = "SQLite backend for TaskChampion-sync-server" description = "SQLite backend for TaskChampion-sync-server"
license = "MIT" license = "MIT"
[dependencies] [dependencies]
taskchampion-sync-server-core = { path = "../core", version = "0.5.0-pre" } taskchampion-sync-server-core = { path = "../core", version = "0.5.1-pre" }
uuid.workspace = true uuid.workspace = true
anyhow.workspace = true anyhow.workspace = true
thiserror.workspace = true thiserror.workspace = true