cargo-binstall/.github/workflows/release.yml
dependabot[bot] 25a4ceb050
Bump mathieudutour/github-tag-action from 6.0 to 6.1 (#502)
Bumps [mathieudutour/github-tag-action](https://github.com/mathieudutour/github-tag-action) from 6.0 to 6.1.
- [Release notes](https://github.com/mathieudutour/github-tag-action/releases)
- [Commits](https://github.com/mathieudutour/github-tag-action/compare/v6.0...v6.1)

---
updated-dependencies:
- dependency-name: mathieudutour/github-tag-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-31 02:30:40 +00:00

88 lines
2.7 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: ''
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
- build
name: Package and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get outputs
uses: actions/download-artifact@v3
with:
path: outputs/
- name: Pack archives
run: .github/scripts/pack-release-archives.sh
- name: Publish release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
tag_name: ${{ needs.info.outputs.version }}
name: ${{ needs.info.outputs.version }}
body: ${{ needs.info.outputs.notes }}
append_body: true
files: |
outputs/cargo-binstall-*.zip
outputs/cargo-binstall-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}