mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-23 05:58:42 +00:00

* Revert "release: cargo-binstall v1.4.0 (#1397)"
This reverts commit 99e8256018
.
* --allow-dirty on publish
* Remove private key file after generation
* Write public key file to bin crate and to package
* Upload public key file to release
87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
name: On release
|
|
on:
|
|
pull_request:
|
|
types: closed
|
|
branches: [main] # target branch of release PRs
|
|
|
|
jobs:
|
|
info:
|
|
if: github.event.pull_request.merged
|
|
|
|
outputs:
|
|
is-release: ${{ steps.meta.outputs.is-release }}
|
|
crate: ${{ steps.meta.outputs.crates-names }}
|
|
version: ${{ steps.meta.outputs.version-actual }}
|
|
notes: ${{ steps.meta.outputs.notes }}
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- id: meta
|
|
uses: cargo-bins/release-meta@v1
|
|
with:
|
|
event-data: ${{ toJSON(github.event) }}
|
|
extract-notes-under: '### Release notes'
|
|
|
|
libtag:
|
|
if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate != 'cargo-binstall'
|
|
needs: info
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Push lib release tag
|
|
if: needs.info.outputs.crate != 'cargo-binstall'
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
custom_tag: ${{ needs.info.outputs.version }}
|
|
tag_prefix: ${{ needs.info.outputs.crate }}-v
|
|
- name: Publish to crates.io
|
|
run: |
|
|
cargo publish -p '${{ needs.info.outputs.crate }}'
|
|
env:
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
|
|
clitag:
|
|
if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall'
|
|
needs: info
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Push cli release tag
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
custom_tag: ${{ needs.info.outputs.version }}
|
|
tag_prefix: v
|
|
- uses: cargo-bins/cargo-binstall@main
|
|
- name: Create ephemeral keypair
|
|
id: keypair
|
|
run: .github/scripts/ephemeral-gen.sh
|
|
- name: Publish to crates.io
|
|
env:
|
|
crate: ${{ needs.info.outputs.crate }}
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
run: cargo publish -p "$crate" --allow-dirty
|
|
- name: Upload public key to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
release_name: v${{ needs.info.outputs.version }}
|
|
tag: v${{ needs.info.outputs.version }}
|
|
body: ${{ needs.info.outputs.notes }}
|
|
file: minisign.pub
|
|
outputs:
|
|
publickey: ${{ steps.keypair.outputs.public }}
|
|
signingkey: ${{ steps.keypair.outputs.private }}
|
|
|
|
package:
|
|
if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall'
|
|
needs:
|
|
- info
|
|
- clitag
|
|
uses: ./.github/workflows/release-build.yml
|
|
with:
|
|
publish: ${{ toJSON(needs.info.outputs) }}
|
|
publickey: ${{ needs.clitag.publickey }}
|
|
secrets:
|
|
signingkey: ${{ needs.clitag.signingkey }}
|