Release paper-age version 1.2.0 #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.create-gh-release.outputs.computed-prefix }}${{ steps.create-gh-release.outputs.version }} | |
version: ${{ steps.create-gh-release.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Changelog variable | |
if: ${{ !(contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'prerelease') || contains(github.ref, 'rc')) }} | |
run: | | |
echo "changelog=CHANGELOG.md" >> $GITHUB_ENV | |
- id: create-gh-release | |
uses: taiki-e/create-gh-release-action@v1 | |
with: | |
draft: true | |
changelog: ${{ env.changelog }} | |
# (required) GitHub token for creating GitHub Releases. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-assets: | |
needs: [create-release] | |
strategy: | |
matrix: | |
include: | |
# Linux (ARM and x86-64) | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
# macOS targets (Universal only) | |
- target: universal-apple-darwin | |
os: macos-latest | |
# Windows (x86-64) | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: release-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Include documentation files variable (macOS) | |
if: ${{ matrix.target == 'universal-apple-darwin' }} | |
run: | | |
echo "include_docs=target/aarch64-apple-darwin/release/man,target/aarch64-apple-darwin/release/completion" >> $GITHUB_ENV | |
- name: Include documentation files variable (windows) | |
if: ${{ matrix.target == 'x86_64-pc-windows-msvc' }} | |
run: | | |
echo "include_docs=target/${{ matrix.target }}/release/man,target/${{ matrix.target }}/release/completion" >> $env:GITHUB_ENV | |
- name: Include documentation files variable (linux) | |
if: ${{ contains(matrix.target, 'linux') }} | |
run: | | |
echo "include_docs=target/${{ matrix.target }}/release/man,target/${{ matrix.target }}/release/completion" >> $GITHUB_ENV | |
- uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload. | |
# Note that glob pattern is not supported yet. | |
bin: paper-age | |
# (optional) Comma-separated list of algorithms to be used for checksum (sha256, sha512, sha1, or md5) | |
checksum: sha256 | |
# (optional) Target triple, default is host triple. | |
target: ${{ matrix.target }} | |
# (optional) Comma-separated list of additional files to be included to archive. | |
include: README.md,LICENSE.txt,src/assets/fonts/IBMPlexMono-LICENSE.txt,${{ env.include_docs }} | |
# (required) GitHub token for uploading assets to GitHub Releases. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
publish-release: | |
needs: [create-release, upload-assets] | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: mark release as non-draft | |
run: | | |
gh release edit ${{ needs.create-release.outputs.tag }} --draft=false | |
update-homebrew: | |
needs: [create-release, upload-assets, publish-release] | |
if: ${{ !(contains(needs.create-release.outputs.tag, 'alpha') || contains(needs.create-release.outputs.tag, 'beta') || contains(needs.create-release.outputs.tag, 'prerelease') || contains(needs.create-release.outputs.tag, 'rc')) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update Homebrew Formula | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: matiaskorhonen/homebrew-paper-age | |
event-type: "Update Homebrew Formula" | |
client-payload: '{ "version": "${{ needs.create-release.outputs.version }}" }' |