Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
tags:
- v0.*


permissions:
contents: write

jobs:
release:
name: Build and publish release artifacts
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true

- name: Test
run: go test ./...

- name: Set up GCP credentials
run: echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' > gcp-secret.json

- name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm \
-v "${PWD}:/workspace" \
-w /workspace \
-e GITHUB_TOKEN \
-e GOOGLE_APPLICATION_CREDENTIALS=/workspace/gcp-secret.json \
ghcr.io/goreleaser/goreleaser-cross:v1.25-v2.12.7 \
release --clean --parallelism 4

- name: Clean up GCP credentials
if: always()
run: rm -f gcp-secret.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist
TODO*
launch.json
apimetrics
gcp-secret.json
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ builds:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++

blobs:
- provider: gs
bucket: apimetrics-cli
directory: "{{ .Version }}"

archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format_overrides:
Expand Down