Skip to content

update homebrew

update homebrew #24

Workflow file for this run

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 }})"
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