From 3b1ae6d2a3dfdf22ccf47b91a6eb323e39657652 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Mon, 16 Dec 2024 03:35:00 +0000 Subject: [PATCH] Followup to the 0.5.0 release * 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 --- .github/workflows/build.yml | 58 ------------------------------------ .github/workflows/docker.yml | 2 -- Cargo.lock | 6 ++-- README.md | 12 ++++++-- RELEASING.md | 19 ++++++++++++ core/Cargo.toml | 2 +- docker-compose.yml | 2 +- server/Cargo.toml | 2 +- sqlite/Cargo.toml | 4 +-- 9 files changed, 36 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 RELEASING.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index efe9a0d..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -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 }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1738f24..6840527 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,8 +2,6 @@ name: Build Docker on: push: - branches: - - '*' tags: - '*' diff --git a/Cargo.lock b/Cargo.lock index bed1a41..e910a5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1558,7 +1558,7 @@ dependencies = [ [[package]] name = "taskchampion-sync-server" -version = "0.4.1" +version = "0.5.1-pre" dependencies = [ "actix-rt", "actix-web", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "taskchampion-sync-server-core" -version = "0.5.0-pre" +version = "0.5.1-pre" dependencies = [ "anyhow", "chrono", @@ -1593,7 +1593,7 @@ dependencies = [ [[package]] name = "taskchampion-sync-server-storage-sqlite" -version = "0.5.0-pre" +version = "0.5.1-pre" dependencies = [ "anyhow", "chrono", diff --git a/README.md b/README.md index 3be02cd..0b3a336 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,11 @@ use a reverse proxy such as Nginx, haproxy, or Apache httpd. ### 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 sufficient to run taskchampion-sync-server, including setting up TLS 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 -log a msg "certificate obtained successfully" when this is complete, or error -messages if the process fails. Once this process is complete, configure your -`.taskrc`'s to point to the server: +log a message "certificate obtained successfully" when this is complete, or +error messages if the process fails. Once this process is complete, configure +your `.taskrc`'s to point to the server: ``` sync.server.url=https://taskwarrior.example.com @@ -108,6 +113,7 @@ cargo build --release After build the binary is located in `target/release/taskchampion-sync-server`. + ### Building the Container To build the container execute the following commands. diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..2d15d91 --- /dev/null +++ b/RELEASING.md @@ -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 diff --git a/core/Cargo.toml b/core/Cargo.toml index 0944bdd..dd2caeb 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "taskchampion-sync-server-core" -version = "0.5.0-pre" +version = "0.5.1-pre" authors = ["Dustin J. Mitchell "] edition = "2021" description = "Core of sync protocol for TaskChampion" diff --git a/docker-compose.yml b/docker-compose.yml index 7d6255d..2dbf2e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,7 +46,7 @@ services: condition: service_completed_successfully tss: - image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:main + image: ghcr.io/gothenburgbitfactory/taskchampion-sync-server:latest restart: unless-stopped volumes: - type: volume diff --git a/server/Cargo.toml b/server/Cargo.toml index f631ac5..15ca6e1 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "taskchampion-sync-server" -version = "0.4.1" +version = "0.5.1-pre" authors = ["Dustin J. Mitchell "] edition = "2021" publish = false diff --git a/sqlite/Cargo.toml b/sqlite/Cargo.toml index 7187891..c082cf0 100644 --- a/sqlite/Cargo.toml +++ b/sqlite/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "taskchampion-sync-server-storage-sqlite" -version = "0.5.0-pre" +version = "0.5.1-pre" authors = ["Dustin J. Mitchell "] edition = "2021" description = "SQLite backend for TaskChampion-sync-server" license = "MIT" [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 anyhow.workspace = true thiserror.workspace = true