mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Adapt release workflow for workspace (#331)
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
f5a682ccce
commit
e21617cc9e
11 changed files with 33 additions and 20 deletions
|
@ -2,5 +2,7 @@
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
message="$(head -n1 <<< "$COMMIT_MESSAGE")"
|
message="$(head -n1 <<< "$COMMIT_MESSAGE")"
|
||||||
version="$(cut -d ' ' -f 2 <<< "${message}")"
|
crate="$(cut -d ' ' -f 2 <<< "${message}")"
|
||||||
|
version="$(cut -d ' ' -f 3 <<< "${message}")"
|
||||||
|
echo "::set-output name=crate::${crate}"
|
||||||
echo "::set-output name=version::${version}"
|
echo "::set-output name=version::${version}"
|
||||||
|
|
2
.github/scripts/release-pr-template.ejs
vendored
2
.github/scripts/release-pr-template.ejs
vendored
|
@ -29,7 +29,7 @@ You will still need to manually publish the cargo crate:
|
||||||
```
|
```
|
||||||
$ git pull
|
$ git pull
|
||||||
$ git switch --detach v{version}
|
$ git switch --detach v{version}
|
||||||
$ cargo publish
|
$ cargo publish -p <%= crate.name %>
|
||||||
```
|
```
|
||||||
|
|
||||||
<% if (pr.releaseNotes) { %>
|
<% if (pr.releaseNotes) { %>
|
||||||
|
|
2
.github/workflows/release-pr.yml
vendored
2
.github/workflows/release-pr.yml
vendored
|
@ -36,5 +36,5 @@ jobs:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: ${{ inputs.version }}
|
version: ${{ inputs.version }}
|
||||||
crate-path: crates/${{ inputs.crate }}
|
crate-path: crates/${{ inputs.crate }}
|
||||||
pr-release-notes: true
|
pr-release-notes: ${{ inputs.crate == 'bin' }}
|
||||||
pr-template-file: .github/scripts/release-pr-template.ejs
|
pr-template-file: .github/scripts/release-pr-template.ejs
|
||||||
|
|
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
|
@ -9,9 +9,10 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
info:
|
info:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# the commit message will look like: `release: v{version} (#{pr-number})`
|
# the commit message will look like: `release: {crate-name} v{version} (#{pr-number})`
|
||||||
if: "startsWith(github.event.head_commit.message, 'release: v')"
|
if: "startsWith(github.event.head_commit.message, 'release: ')"
|
||||||
outputs:
|
outputs:
|
||||||
|
crate: ${{ steps.version.outputs.crate }}
|
||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
notes: ${{ fromJSON(steps.notes.outputs.notes_json) }}
|
notes: ${{ fromJSON(steps.notes.outputs.notes_json) }}
|
||||||
env:
|
env:
|
||||||
|
@ -33,7 +34,15 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Push release tag
|
- name: Push lib release tag
|
||||||
|
if: "! startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||||
|
uses: mathieudutour/github-tag-action@v6.0
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
custom_tag: ${{ needs.info.outputs.version }}
|
||||||
|
tag_prefix: ${{ needs.info.outputs.crate }}-
|
||||||
|
- name: Push cli release tag
|
||||||
|
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||||
uses: mathieudutour/github-tag-action@v6.0
|
uses: mathieudutour/github-tag-action@v6.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -41,12 +50,14 @@ jobs:
|
||||||
tag_prefix: ''
|
tag_prefix: ''
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||||
needs: info # not really, but just so it fails fast
|
needs: info # not really, but just so it fails fast
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
with:
|
||||||
for_release: true
|
for_release: true
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||||
needs:
|
needs:
|
||||||
- info
|
- info
|
||||||
- tag
|
- tag
|
||||||
|
|
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "binstall"
|
name = "binstall"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
@ -380,7 +380,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "detect-targets"
|
name = "detect-targets"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"guess_host_triple",
|
"guess_host_triple",
|
||||||
|
@ -389,7 +389,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "detect-wasi"
|
name = "detect-wasi"
|
||||||
version = "1.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
@ -532,7 +532,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flock"
|
name = "flock"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fs4",
|
"fs4",
|
||||||
]
|
]
|
||||||
|
@ -1137,7 +1137,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "normalize-path"
|
name = "normalize-path"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-integer"
|
name = "num-integer"
|
||||||
|
|
|
@ -18,7 +18,7 @@ pkg-fmt = "zip"
|
||||||
pkg-fmt = "zip"
|
pkg-fmt = "zip"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
binstall = { path = "../lib", version = "0.1.0" }
|
binstall = { path = "../lib", version = "0.0.0" }
|
||||||
clap = { version = "3.2.17", features = ["derive"] }
|
clap = { version = "3.2.17", features = ["derive"] }
|
||||||
crates_io_api = { version = "0.8.0", default-features = false }
|
crates_io_api = { version = "0.8.0", default-features = false }
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "detect-targets"
|
||||||
description = "Detect the target of the env at runtime"
|
description = "Detect the target of the env at runtime"
|
||||||
repository = "https://github.com/cargo-bins/cargo-binstall"
|
repository = "https://github.com/cargo-bins/cargo-binstall"
|
||||||
documentation = "https://docs.rs/detect-target"
|
documentation = "https://docs.rs/detect-target"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "detect-wasi"
|
||||||
description = "Detect if WASI can be run"
|
description = "Detect if WASI can be run"
|
||||||
repository = "https://github.com/cargo-bins/cargo-binstall"
|
repository = "https://github.com/cargo-bins/cargo-binstall"
|
||||||
documentation = "https://docs.rs/detect-wasi"
|
documentation = "https://docs.rs/detect-wasi"
|
||||||
version = "1.0.0"
|
version = "0.0.0"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
authors = ["Félix Saparelli <felix@passcod.name>"]
|
authors = ["Félix Saparelli <felix@passcod.name>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "flock"
|
||||||
description = "Locked files that can be used like normal File"
|
description = "Locked files that can be used like normal File"
|
||||||
repository = "https://github.com/cargo-bins/cargo-binstall"
|
repository = "https://github.com/cargo-bins/cargo-binstall"
|
||||||
documentation = "https://docs.rs/flock"
|
documentation = "https://docs.rs/flock"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "binstall"
|
||||||
description = "Library backend for cargo-binstall"
|
description = "Library backend for cargo-binstall"
|
||||||
repository = "https://github.com/cargo-bins/cargo-binstall"
|
repository = "https://github.com/cargo-bins/cargo-binstall"
|
||||||
documentation = "https://docs.rs/binstall"
|
documentation = "https://docs.rs/binstall"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
authors = ["ryan <ryan@kurte.nz>"]
|
authors = ["ryan <ryan@kurte.nz>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
@ -17,10 +17,10 @@ cargo_toml = "0.11.5"
|
||||||
clap = { version = "3.2.17", features = ["derive"] }
|
clap = { version = "3.2.17", features = ["derive"] }
|
||||||
compact_str = { version = "0.6.0", features = ["serde"] }
|
compact_str = { version = "0.6.0", features = ["serde"] }
|
||||||
crates_io_api = { version = "0.8.0", default-features = false }
|
crates_io_api = { version = "0.8.0", default-features = false }
|
||||||
detect-targets = { version = "0.1.0", path = "../detect-targets" }
|
detect-targets = { version = "0.0.0", path = "../detect-targets" }
|
||||||
digest = "0.10.3"
|
digest = "0.10.3"
|
||||||
flate2 = { version = "1.0.24", default-features = false }
|
flate2 = { version = "1.0.24", default-features = false }
|
||||||
flock = { version = "0.1.0", path = "../flock" }
|
flock = { version = "0.0.0", path = "../flock" }
|
||||||
futures-util = { version = "0.3.23", default-features = false, features = ["std"] }
|
futures-util = { version = "0.3.23", default-features = false, features = ["std"] }
|
||||||
generic-array = "0.14.6"
|
generic-array = "0.14.6"
|
||||||
home = "0.5.3"
|
home = "0.5.3"
|
||||||
|
@ -28,7 +28,7 @@ itertools = "0.10.3"
|
||||||
jobserver = "0.1.24"
|
jobserver = "0.1.24"
|
||||||
log = { version = "0.4.17", features = ["std"] }
|
log = { version = "0.4.17", features = ["std"] }
|
||||||
miette = "5.3.0"
|
miette = "5.3.0"
|
||||||
normalize-path = { version = "0.1.0", path = "../normalize-path" }
|
normalize-path = { version = "0.0.0", path = "../normalize-path" }
|
||||||
once_cell = "1.13.0"
|
once_cell = "1.13.0"
|
||||||
reqwest = { version = "0.11.11", features = ["stream"], default-features = false }
|
reqwest = { version = "0.11.11", features = ["stream"], default-features = false }
|
||||||
scopeguard = "1.1.0"
|
scopeguard = "1.1.0"
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "normalize-path"
|
||||||
description = "Like canonicalize, but without performing I/O"
|
description = "Like canonicalize, but without performing I/O"
|
||||||
repository = "https://github.com/cargo-bins/cargo-binstall"
|
repository = "https://github.com/cargo-bins/cargo-binstall"
|
||||||
documentation = "https://docs.rs/normalize-path"
|
documentation = "https://docs.rs/normalize-path"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
authors = ["Jiahao XU <Jiahao_XU@outlook.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue