github.com/grafana/pyroscope@v1.18.0/.github/workflows/release.yml (about) 1 name: goreleaser 2 3 on: 4 push: 5 # run only against tags 6 tags: 7 - "v*" 8 9 permissions: 10 contents: write 11 packages: write 12 id-token: write 13 # issues: write 14 15 jobs: 16 goreleaser: 17 runs-on: ubuntu-x64-large 18 steps: 19 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 20 with: 21 fetch-depth: 0 22 persist-credentials: 'false' 23 - name: Set GIT_LAST_COMMIT_DATE 24 run: echo "GIT_LAST_COMMIT_DATE=$(git log -1 --date=iso-strict --format=%cd)" >> $GITHUB_ENV 25 - name: Set IMAGE_TAG from git tag 26 run: echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV 27 - name: Set IMAGE_PUBLISH_LATEST=true, so we overwrite the latest docker image tag and update Homebrew 28 run: echo "IMAGE_PUBLISH_LATEST=true" >> $GITHUB_ENV 29 # Forces goreleaser to use the correct previous tag for the changelog 30 - name: Set GORELEASER_PREVIOUS_TAG 31 run: echo "GORELEASER_PREVIOUS_TAG=$(git tag -l --sort=-version:refname | grep -E '^v.*' | head -n 2 | tail -1)" >> $GITHUB_ENV 32 - run: git fetch --force --tags 33 - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 34 with: 35 go-version: "1.24.12" 36 cache: false 37 - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 38 with: 39 node-version: 20 40 package-manager-cache: false 41 # setup docker buildx 42 - name: Set up QEMU 43 uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 44 - name: Set up Docker Buildx 45 uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 46 # login to docker hub 47 - id: get-secrets 48 uses: grafana/shared-workflows/actions/get-vault-secrets@bae259f9ed5b6fcb050e3b58adf7aee776d4edb5 49 with: 50 common_secrets: | 51 DOCKERHUB_USERNAME=dockerhub:username 52 DOCKERHUB_PASSWORD=dockerhub:password 53 repo_secrets: | 54 GRAFANA_PYROSCOPE_BOT_APP_APP_ID=grafana-pyroscope-bot:app-id 55 GRAFANA_PYROSCOPE_BOT_APP_PRIVATE_KEY=grafana-pyroscope-bot:app-private-key 56 - name: Get github app token (valid for an hour) 57 id: brew-token 58 uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 59 with: 60 app-id: ${{ env.GRAFANA_PYROSCOPE_BOT_APP_APP_ID }} 61 private-key: ${{ env.GRAFANA_PYROSCOPE_BOT_APP_PRIVATE_KEY }} 62 owner: pyroscope-io 63 repositories: homebrew-brew 64 - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2 65 name: Login to Docker Hub 66 with: 67 username: ${{ env.DOCKERHUB_USERNAME }} 68 password: ${{ env.DOCKERHUB_PASSWORD }} 69 - run: make frontend/build 70 - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 71 with: 72 # ensure this aligns with the version specified in the /Makefile 73 version: v2.13.2 74 args: release --clean --timeout 60m 75 env: 76 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 77 GORELEASER_CURRENT_TAG: ${{ github.ref_name }} 78 # make generate-formulas expects PYROSCOPE_TAG to be set 79 - name: Set PYROSCOPE_TAG 80 run: echo "PYROSCOPE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 81 # Our Homebrew publishing currently assumes latest releases only 82 - if: env.IMAGE_PUBLISH_LATEST == 'true' 83 name: Update homebrew formulas 84 run: | 85 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" 2> /dev/null 86 git config --global user.email "dmitry+bot@pyroscope.io" 87 git config --global user.name "Pyroscope Bot <dmitry+bot@pyroscope.io>" 88 git clone https://github.com/pyroscope-io/homebrew-brew ../homebrew-brew 89 cd ../homebrew-brew 90 make generate-formulas && git add Formula && git commit -m "chore: update formulas" && git push origin main 91 env: 92 HOMEBREW_GITHUB_TOKEN: ${{ steps.brew-token.outputs.token }} 93 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}