mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-23 22:18:41 +00:00
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags-ignore:
|
|
- "*"
|
|
|
|
jobs:
|
|
info:
|
|
runs-on: ubuntu-latest
|
|
# 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:
|
|
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Extract tag from commit message
|
|
id: version
|
|
run: .github/scripts/extract-tag-from-release-commit.sh
|
|
- name: Extract release notes
|
|
id: notes
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITHUB_REPO: ${{ github.repository }}
|
|
run: .github/scripts/extract-release-notes.sh
|
|
|
|
tag:
|
|
needs: info
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Push lib release tag
|
|
if: "! startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
|
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 }}-
|
|
- name: Push cli release tag
|
|
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
custom_tag: ${{ needs.info.outputs.version }}
|
|
tag_prefix: ''
|
|
|
|
package:
|
|
if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')"
|
|
needs:
|
|
- info
|
|
- tag
|
|
uses: ./.github/workflows/release-build.yml
|
|
with:
|
|
publish: ${{ toJSON(needs.info.outputs) }}
|