From 22a24330f4efaf2c96979832968aa0777dc37a03 Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 27 Sep 2023 09:41:54 -0400 Subject: [PATCH 1/3] chore: write changelog, quick doc fixes --- CHANGELOG.md | 110 +++++++++++++++++++++++++++++++++++ book/src/introduction.md | 2 +- book/src/reference/config.md | 7 ++- 3 files changed, 117 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e86db1903..b5d02c6fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,115 @@ # Unreleased +This release is a big overhaul of cargo-dist's UX! [Our CI scripts have been completely redesigned](https://opensource.axo.dev/cargo-dist/book/introduction.html#distributing) to allow your release process to be tested in pull-requests, so you don't have to worry as much about your release process breaking! + +Since we can now test your release process frequently, we've also made most cargo-dist commands default to erroring out if anything is out of sync and needs to be regenerated. + +To make this easier, we've also introduced an experimental new system for [user-defined hooks](https://opensource.axo.dev/cargo-dist/book/ci/github.html#custom-jobs), allowing you to write custom publish jobs without having to actually edit release.yml. + +This release also introduces initial support for msi installers with the wonderful help of [cargo-wix](https://github.com/volks73/cargo-wix)! + + + +## Features + +### CI redesign + +This is the big ticket item of the release, the CI has been completely redesigned! We recommend reading the docs below for details, but some high-level details: + +* The CI now runs `cargo dist plan` on pull-requests +* This can be cranked up to `cargo dist build`, with results uploaded to the PR workflow, allowing you to download+test them +* To do this, we now use GitHub's upload-artifact/download-artifact system, instead of using a draft GitHub release as scratch storage +* This means we also no longer create a draft Release on startup, and instead transactionally create the full Release at the very end +* `cargo dist plan` will now check that the CI script is up to date and not hand-edited (can be opted out) + * The user-defined publish jobs feature helps you avoid hand-edits + * More such features are in the pipeline for the next release! + +* impl + * @mistydemeo + @gankra [initial impl](https://github.com/axodotdev/cargo-dist/pull/378) + * @gankra [cleanup init logic](https://github.com/axodotdev/cargo-dist/pull/392) + * @mistydemeo [use checkout@v4](https://github.com/axodotdev/cargo-dist/pull/442) + * @mistydemeo [add docs](https://github.com/axodotdev/cargo-dist/pull/443) + +* docs + * [high-level summary](https://opensource.axo.dev/cargo-dist/book/introduction.html#distributing) + * [detailed docs](https://opensource.axo.dev/cargo-dist/book/ci/github.html) + +### user-defined publish jobs + +You can now define custom hand-written publish jobs that cargo-dist's CI will know how to invoke, without actually having to hand-edit release.yml! + +* @mistydemeo [impl](https://github.com/axodotdev/cargo-dist/pull/417) +* [docs](https://opensource.axo.dev/cargo-dist/book/ci/github.html#custom-jobs) + +### default to not publishing prereleases to homebrew + +Homebrew doesn't have a notion of package "versions", there is Only The Latest Version, so we changed the default to only publishing to your homebrew tap if you're cutting a stable release. You can opt back in to the old behaviour with `publish-prereleases = true`. + +* @mistydemeo [impl](https://github.com/axodotdev/cargo-dist/pull/401) +* [docs](https://opensource.axo.dev/cargo-dist/book/reference/config.html#publish-prereleases) + +### generate command + +This feature is a bit of an internal affair that you don't necessarily need to care about, but it's big enough that we figured it's worth mentioning. + +The "plumbing" `generate-ci` command which is invoked by `cargo dist init` has been reworked into a more general `generate` command, as the introduction of msi installers means we now have two kinds of checked-in generated output. + +Most notably, `generate --check` now exists, which produces an error if `generate` would change the contents (ignoring newline-style). **Most cargo-dist commands now run `generate --check` on startup, making it an error to have your release.yml out of date or hand-edited**. This is a key piece to the puzzle of the new CI design, as it lets you catch issues with your release process in PRs. + +The `allow-dirty = ["ci"]` config was introduced to disable these `generate` modifying or checking release.yml, for users that still really need to hand-edit. We're actively working on several features that should make it less necessary to do hand-edits. + +* impl + * @mistydemeo [initial impl](https://github.com/axodotdev/cargo-dist/pull/381) + * @gankra [generalize for msi](https://github.com/axodotdev/cargo-dist/pull/391) + * @gankra [improved --allow-dirty behaviour](https://github.com/axodotdev/cargo-dist/pull/397) + * @mistydemeo [default to --artifacts=all in generate](https://github.com/axodotdev/cargo-dist/pull/410) + * @gankra [ignore newline style when checking file equality](https://github.com/axodotdev/cargo-dist/pull/414) + * @mistydemeo [hide generate-ci alias command](https://github.com/axodotdev/cargo-dist/pull/434) + * @gankra [cleanup more references to generate-ci](https://github.com/axodotdev/cargo-dist/pull/444) +* docs + * [generate cli command](https://opensource.axo.dev/cargo-dist/book/reference/cli.html#cargo-dist-generate) + * [allow-dirty config](https://opensource.axo.dev/cargo-dist/book/reference/config.html#allow-dirty) + +### msi installer + +Initial msi installer support is here, based on the wonderful [cargo-wix](https://volks73.github.io/cargo-wix/cargo_wix/). We contributed several upstream improvements to cargo-wix for our purposes, and look forward to helping out even more in the future! + +* impl + * @gankra [initial impl](https://github.com/axodotdev/cargo-dist/pull/370) + * @gankra [properly handle multiple subscribers to a binary](https://github.com/axodotdev/cargo-dist/pull/421) + * @gankra [don't forward WiX output to stdout](https://github.com/axodotdev/cargo-dist/pull/418) +* [docs](https://opensource.axo.dev/cargo-dist/book/installers/msi.html) + +## Fixes + +### more useful checksum files + +The checksum files we generate are now in the expected format for tools like sha256sum, making them more immediately useful. + +* @gankra [impl](https://github.com/axodotdev/cargo-dist/pull/420) + +## Maintenance + +### more polished cli output + +CLI Output has been streamlined and cleaned up a lot in this release! + +* @gankra [remove redundant output](https://github.com/axodotdev/cargo-dist/pull/411) +* @gankra [various improvements](https://github.com/axodotdev/cargo-dist/pull/437) +* @gankra [better help diagnostics](https://github.com/axodotdev/cargo-dist/pull/447) + +### refreshed docs + +The docs have been significantly reworked to reflect how much cargo-dist has changed and improved over the last few releases. Installers have rapidly grown from "something we're trying out" to "the star of the show", so they're now front-and-center with room for their own guides. + +This was a big undertaking, and not everything has been reworked yet. Further improvements will be done more incrementally. + +* @gankra [big docs overhaul](https://github.com/axodotdev/cargo-dist/pull/451) +* @mistydemeo [don't suggest --profile in install instructions](https://github.com/axodotdev/cargo-dist/pull/404) +* @tshepang [make search more useful](https://github.com/axodotdev/cargo-dist/pull/386) +* @tshepang [remove stray char](https://github.com/axodotdev/cargo-dist/pull/388) + + # Version 0.2.0 (2023-08-30) This release includes a bunch of features that resolve several of our user's needs. diff --git a/book/src/introduction.md b/book/src/introduction.md index 4875e5dd8..a0a139f48 100644 --- a/book/src/introduction.md +++ b/book/src/introduction.md @@ -50,7 +50,7 @@ That's a short list because "we make [installers][]" is doing a lot of heavy lif As a distribution tool, cargo-dist gets to flex its biggest superpower: **it generates [its own CI scripts][ci-providers]**. For instance, enabling [GitHub CI][github-ci] with `cargo dist init` will generate release.yml, which implements the full pipeline of plan, build, host, publish, announce: * Plan - * Waits for you to push a git tag for a new version (v1.0.0, my-app-v1.0.0, my-app/1.0.0, ...) + * Waits for you to push a git tag for a new version (v1.0.0, my-app-1.0.0...) * Selects what apps in your workspace to announce new releases for based on that tag * Generates [a machine-readable manifest][manifest] with changelogs and build plans * Build diff --git a/book/src/reference/config.md b/book/src/reference/config.md index 65cf5dd4c..3a83352d4 100644 --- a/book/src/reference/config.md +++ b/book/src/reference/config.md @@ -99,10 +99,15 @@ This is a list of CI backends you want to support, allowing subsequent runs of [ > since 0.3.0 -Example: `allow-dirty = ["ci"]` +Example: `allow-dirty = ["ci", "msi"]` This is a list of generate tasks for cargo-dist to ignore when checking if generated configuration is up to date. It's useful for users who customize their own configuration beyond cargo-dist's generated defaults and want to avoid cargo-dist overwriting it. +Possible values are: + +* "ci": don't check/regenerate ci scripts (release.yml) +* "msi": don't check/regenerate msi templates (main.wxs) + ### targets > since 0.0.3 From eeace20968aa03d01f3863bdee31d9117e78575f Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 27 Sep 2023 09:44:48 -0400 Subject: [PATCH 2/3] chore: update bootstrap dist to 0.3.0-prerelease.9 --- .github/workflows/release.yml | 16 ++++++++-------- Cargo.toml | 8 +++++--- cargo-dist/tests/snapshots/error_manifest.snap | 3 +-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00fc0456a..7c2118d96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ # CI that: # # * checks for a Git Tag that looks like a release -# * builds artifacts with cargo-dist (executable-zips, installers, hashes) +# * builds artifacts with cargo-dist (archives, installers, hashes) # * uploads those artifacts to temporary workflow zip # * on success, uploads the artifacts to a Github Releaseā„¢ # @@ -54,11 +54,11 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0-prerelease.4/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0-prerelease.9/cargo-dist-installer.sh | sh" - id: plan run: | cargo dist plan ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} --output-format=json > dist-manifest.json @@ -93,7 +93,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: swatinem/rust-cache@v2 @@ -127,11 +127,11 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0-prerelease.4/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.3.0-prerelease.9/cargo-dist-installer.sh | sh" # Get all the local artifacts for the global tasks to use (for e.g. checksums) - name: Fetch local artifacts uses: actions/download-artifact@v3 @@ -175,7 +175,7 @@ jobs: GITHUB_EMAIL: "admin+bot@axo.dev" if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: repository: "axodotdev/homebrew-tap" token: ${{ secrets.HOMEBREW_TAP_TOKEN }} @@ -206,7 +206,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: "Download artifacts" diff --git a/Cargo.toml b/Cargo.toml index a0aa47cac..89de98858 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ pre-release-commit-message = "release: {{version}}" # Config for 'cargo dist' [workspace.metadata.dist] # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.3.0-prerelease.4" -# CI backends to support (see 'cargo dist generate-ci') +cargo-dist-version = "0.3.0-prerelease.9" +# CI backends to support ci = ["github"] # The installers to generate for each app installers = ["shell", "powershell", "homebrew"] @@ -23,7 +23,9 @@ tap = "axodotdev/homebrew-tap" # Publish jobs to run in CI publish-jobs = ["homebrew"] # Target platforms to build apps for (Rust target-triple syntax) -targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"] +targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"] +# Publish jobs to run in CI +pr-run-mode = "plan" # The profile that 'cargo dist' will build with [profile.dist] diff --git a/cargo-dist/tests/snapshots/error_manifest.snap b/cargo-dist/tests/snapshots/error_manifest.snap index d398013df..888a79875 100644 --- a/cargo-dist/tests/snapshots/error_manifest.snap +++ b/cargo-dist/tests/snapshots/error_manifest.snap @@ -14,8 +14,7 @@ stderr: --tag=v1.0.0-FAKEVERSION will Announce: cargo-dist - you can also request any single package with --tag=cargo-dist- - v1.0.0-FAKEVERSION + you can also request any single package with --tag=cargo-dist-v1.0.0-FAKEVERSION From 31b4724020ad11ae68ba9e1b4e3a33f4f807627a Mon Sep 17 00:00:00 2001 From: Aria Beingessner Date: Wed, 27 Sep 2023 09:45:19 -0400 Subject: [PATCH 3/3] release: 0.3.0 --- CHANGELOG.md | 5 +++++ Cargo.lock | 4 ++-- cargo-dist-schema/Cargo.toml | 2 +- cargo-dist/Cargo.toml | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5d02c6fc..01f4a6f32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Unreleased +Nothing Yet! + + +# Version 0.3.0 (2023-09-27) + This release is a big overhaul of cargo-dist's UX! [Our CI scripts have been completely redesigned](https://opensource.axo.dev/cargo-dist/book/introduction.html#distributing) to allow your release process to be tested in pull-requests, so you don't have to worry as much about your release process breaking! Since we can now test your release process frequently, we've also made most cargo-dist commands default to erroring out if anything is out of sync and needs to be regenerated. diff --git a/Cargo.lock b/Cargo.lock index e25549333..6f1aa5e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,7 +290,7 @@ dependencies = [ [[package]] name = "cargo-dist" -version = "0.3.0-prerelease.9" +version = "0.3.0" dependencies = [ "axoasset", "axocli", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "cargo-dist-schema" -version = "0.3.0-prerelease.9" +version = "0.3.0" dependencies = [ "camino", "insta", diff --git a/cargo-dist-schema/Cargo.toml b/cargo-dist-schema/Cargo.toml index fb599b721..7237d02a3 100644 --- a/cargo-dist-schema/Cargo.toml +++ b/cargo-dist-schema/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist-schema" description = "Schema information for cargo-dist's dist-manifest.json" -version = "0.3.0-prerelease.9" +version = "0.3.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" diff --git a/cargo-dist/Cargo.toml b/cargo-dist/Cargo.toml index 092500050..3bd192ced 100644 --- a/cargo-dist/Cargo.toml +++ b/cargo-dist/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-dist" description = "Shippable application packaging for Rust" -version = "0.3.0-prerelease.9" +version = "0.3.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/axodotdev/cargo-dist" @@ -30,7 +30,7 @@ clap-cargo = { version = "0.10.0", optional = true } axocli = { version = "0.1.0", optional = true } # Features used by the cli and library -cargo-dist-schema = { version = "=0.3.0-prerelease.9", path = "../cargo-dist-schema" } +cargo-dist-schema = { version = "=0.3.0", path = "../cargo-dist-schema" } axoasset = { version = "0.5.1", features = ["json-serde", "toml-serde", "toml-edit", "compression"] } axoproject = { version = "0.4.7", default-features = false, features = ["cargo-projects"] }