From 750790abe0ec5e1e834445abbdf899e8d691baf3 Mon Sep 17 00:00:00 2001 From: Nolan Jacobson <50815660+nolanjacobson@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:41:02 -0400 Subject: [PATCH] v: updates to workflows for goreleaser --- .github/workflows/.goreleaser.yml | 43 +++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 18 +++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/.goreleaser.yml diff --git a/.github/workflows/.goreleaser.yml b/.github/workflows/.goreleaser.yml new file mode 100644 index 00000000..312fe463 --- /dev/null +++ b/.github/workflows/.goreleaser.yml @@ -0,0 +1,43 @@ +# Make sure to check the documentation at http://goreleaser.com +version: 2 +builds: + - ldflags: + - -w -s + - -X github.com/masa-finance/masa-oracle/internal.Version={{.Tag}} + - -X github.com/masa-finance/masa-oracle/internal.Commit={{.Commit}} + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + - freebsd + goarch: + - amd64 + - arm + - 386 + - arm64 +source: + enabled: true + name_template: '{{ .ProjectName }}-{{ .Tag }}-source' +archives: + # Default template uses underscores instead of - + - name_template: >- + {{ .ProjectName }}-{{ .Tag }}- + {{- if eq .Os "freebsd" }}FreeBSD + {{- else }}{{- title .Os }}{{end}}- + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{end}} + {{- if .Arm }}v{{ .Arm }}{{ end }} +checksum: + name_template: '{{ .ProjectName }}-{{ .Tag }}-checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + - '^Merge pull request' \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 59c539d1..1b6ab069 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,3 +92,21 @@ jobs: gcloud compute instances add-metadata $INSTANCE --metadata masa-oracle-redeploy=latest --zone=$(echo $ZONE | tr -d '\n') done + goreleaser: # Add this new job for GoReleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: v2.0.1 + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}