mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +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
|
||||
|
||||
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}"
|
||||
|
|
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 switch --detach v{version}
|
||||
$ cargo publish
|
||||
$ cargo publish -p <%= crate.name %>
|
||||
```
|
||||
|
||||
<% 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 }}
|
||||
version: ${{ inputs.version }}
|
||||
crate-path: crates/${{ inputs.crate }}
|
||||
pr-release-notes: true
|
||||
pr-release-notes: ${{ inputs.crate == 'bin' }}
|
||||
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:
|
||||
info:
|
||||
runs-on: ubuntu-latest
|
||||
# the commit message will look like: `release: v{version} (#{pr-number})`
|
||||
if: "startsWith(github.event.head_commit.message, 'release: v')"
|
||||
# the commit message will look like: `release: {crate-name} v{version} (#{pr-number})`
|
||||
if: "startsWith(github.event.head_commit.message, 'release: ')"
|
||||
outputs:
|
||||
crate: ${{ steps.version.outputs.crate }}
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
notes: ${{ fromJSON(steps.notes.outputs.notes_json) }}
|
||||
env:
|
||||
|
@ -33,7 +34,15 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- 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
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@ -41,12 +50,14 @@ jobs:
|
|||
tag_prefix: ''
|
||||
|
||||
build:
|
||||
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||
needs: info # not really, but just so it fails fast
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
for_release: true
|
||||
|
||||
release:
|
||||
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
||||
needs:
|
||||
- info
|
||||
- tag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue