Skip to content

chore: release v0.7.8 (#224) #16

chore: release v0.7.8 (#224)

chore: release v0.7.8 (#224) #16

Workflow file for this run

name: Deploy
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "**/docs/**"
- "**.md"
workflow_dispatch:
inputs:
version:
type: string
description: "Version"
required: true
default: "0.1.0"
do-homebrew:
type: boolean
description: "Publish to Homebrew"
required: false
default: true
do-github-release:
type: boolean
description: "Create a GitHub release"
required: false
default: true
jobs:
# call out to build.yml
doing-a-build:
uses: sassman/t-rec-rs/.github/workflows/build.yml@main
publish:
if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')
name: post / cargo publish
needs: [doing-a-build]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: setup | rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# https://github.com/mislav/bump-homebrew-formula-action
publish-to-brew:
name: post / homebrew
runs-on: macos-latest
if: (github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && ${{ github.event.inputs.do-homebrew }})
steps:
- name: Get version from tag
if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')
run: echo RELEASE_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV
shell: bash
- name: Get version from input
if: github.event_name == 'workflow_dispatch'
run: echo RELEASE_VERSION=${{ github.event.inputs.version }} >> $GITHUB_ENV
shell: bash
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: t-rec
tag-name: v${{ env.RELEASE_VERSION }}
version: ${{ env.RELEASE_VERSION }}
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
release:
name: post / github release
runs-on: ubuntu-latest
if: (github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch') && ${{ github.event.inputs.do-github-release }})
steps:
- uses: actions/checkout@v4
- name: setup | rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
default: true
profile: minimal
- name: Get version from tag
if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')
run: echo RELEASE_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV
shell: bash
- name: Get version from input
if: github.event_name == 'workflow_dispatch'
run: echo RELEASE_VERSION=${{ github.event.inputs.version }} >> $GITHUB_ENV
shell: bash
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
version: ${{ env.RELEASE_VERSION }}
path: ./CHANGELOG.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
with:
# This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
tag_name: v${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}