Skip to content

Commit

Permalink
dev: patch cargo-dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Dec 16, 2024
1 parent 9f835ed commit 6b73bbd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.1/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/cargo-dist/releases/download/v0.26.1-tinymist.5/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ members = ["cargo:."]
# Config for 'dist'
[dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.26.1"
cargo-dist-version = "0.26.1-tinymist.5"
cargo-dist-url-override = "https://github.com/Myriad-Dreamin/cargo-dist/releases/download/v0.26.1-tinymist.5"
# CI backends to support
ci = "github"
# The installers to generate for each app
Expand Down Expand Up @@ -32,7 +33,7 @@ targets = [
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"riscv64gc-unknown-linux-gnu",
# "riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"loongarch64-unknown-linux-gnu",
"loongarch64-unknown-linux-musl",
Expand All @@ -49,3 +50,6 @@ dispatch-releases = true
install-updater = false
# Path that installers should place binaries in
install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]

[dist.github-custom-runners]
aarch64-pc-windows-msvc = "windows-latest"
8 changes: 7 additions & 1 deletion scripts/draft-release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import fs from 'fs';

const versionToUpload = process.argv[2];

const DIST_CMD = "dist";
// const DIST_CMD = "cargo run --manifest-path ../cargo-dist/cargo-dist/Cargo.toml --bin dist --";

const run = (command) => {
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
Expand Down Expand Up @@ -34,7 +37,10 @@ const main = async () => {
if (fs.existsSync('target/distrib/dist-manifest.json')) {
fs.unlinkSync('target/distrib/dist-manifest.json');
}
const distManifest = await run('dist host --steps=upload --steps=release --output-format=json');

await run(DIST_CMD + ' generate');

const distManifest = await run(DIST_CMD + ' host --steps=upload --steps=release --output-format=json');
const distData = JSON.parse(distManifest);
const body = distData.announcement_github_body;
// write to file
Expand Down

0 comments on commit 6b73bbd

Please sign in to comment.