fixes homebrew formulas #9
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: goreleaser | |
on: | |
push: | |
# run only against tags | |
tags: | |
- "v*" | |
# do not run for weekly release tags | |
- "!v0.0.0-weekly*" | |
permissions: | |
contents: write | |
packages: write | |
# issues: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set GIT_LAST_COMMIT_DATE | |
run: echo "GIT_LAST_COMMIT_DATE=$(git log -1 --date=iso-strict --format=%cd)" >> $GITHUB_ENV | |
# Forces goreleaser to use the correct previous tag for the changelog | |
- name: Set GORELEASER_PREVIOUS_TAG | |
run: echo "GORELEASER_PREVIOUS_TAG=$(git tag -l --sort=-version:refname | grep -E '^v.*' | head -n 2 | tail -1)" >> $GITHUB_ENV | |
- run: git fetch --force --tags | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "1.21.3" | |
cache: true | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/hydrogen | |
cache: yarn | |
# setup docker buildx | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# login to docker hub | |
- uses: docker/login-action@v2 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- run: make frontend/build | |
- name: Get github app token (valid for an hour) | |
id: app-goreleaser | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: goreleaser/goreleaser-action@v4 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro': | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist --timeout 60m | |
env: | |
GITHUB_TOKEN: ${{ steps.app-goreleaser.outputs.token }} | |
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' | |
# distribution: | |
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
# make generate-formulas expects PYROSCOPE_TAG to be set | |
- name: Set PYROSCOPE_TAG | |
run: echo "PYROSCOPE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Get github app token (valid for an hour) | |
id: brew-token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
repository: pyroscope-io/homebrew-brew | |
- name: Update homebrew formulas | |
run: | | |
git config --global url."https://x-access-token:$(echo "${HOMEBREW_GITHUB_TOKEN}" | xargs)@github.com/pyroscope-io/homebrew-brew".insteadOf "https://github.com/pyroscope-io/homebrew-brew" | |
git config --global user.email "[email protected]" | |
git config --global user.name "Pyroscope Bot <[email protected]>" | |
git clone https://github.com/pyroscope-io/homebrew-brew ../homebrew-brew | |
cd ../homebrew-brew | |
make generate-formulas && git add Formula && git commit -m "chore: update formulas" && git push origin main | |
env: | |
HOMEBREW_GITHUB_TOKEN: ${{ steps.brew-token.outputs.token }} | |
GITHUB_TOKEN: ${{ steps.app-goreleaser.outputs.token }} |