update homebrew #26
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 | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
update-homebrew: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# 0必要? | |
fetch-depth: 0 | |
- name: Build MacOS binary | |
id: build-macos-binary | |
uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
bin: tera | |
target: x86_64-apple-darwin | |
archive: tera-cli-$target | |
checksum: sha256 | |
dry-run: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add tera to PATH | |
run: | | |
mv "target/x86_64-apple-darwin/release/tera" /usr/local/bin | |
- name: Output values for templates | |
id: output-values-for-templates | |
run: | | |
echo GITHUB_REF=$GITHUB_REF | |
RELEASE_VERSION=${GITHUB_REF#refs/*/} | |
RAW_VERSION=${RELEASE_VERSION:1} | |
echo "RAW_VERSION=$RAW_VERSION" >> $GITHUB_OUTPUT | |
SHA256="$(cat ${{ steps.build-macos-binary.outputs.sha256 }} | head --lines=1 )" | |
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT | |
# We do that before hecking out master (in case we were not in master already) | |
- name: Prepare new Formula | |
env: | |
NAME: Tera | |
DESCRIPTION: "A command line utility written in Rust to render templates using the tera templating engine" | |
SITE: https://github.com | |
REPO: chevdor/tera-cli | |
ARCHIVE: ${{ steps.build-macos-binary.outputs.archive }} | |
SHA256: ${{ steps.output-values-for-templates.outputs.SHA256 }} | |
VERSION: ${{ steps.output-values-for-templates.outputs.RAW_VERSION }} | |
run: | | |
tera --version | |
tera --template templates/formula.rb --env-only > $HOME/tera.rb | |
cat $HOME/tera.rb |