From 8acac13040b9ea45fa2716035b3830a1c38b0e43 Mon Sep 17 00:00:00 2001 From: Daniel Pupius Date: Tue, 21 May 2024 14:46:51 -0700 Subject: [PATCH] Goreleaser configuration --- .github/workflows/goreleaser.yml | 26 ++++++++++++++++++++++++++ .github/workflows/test.yml | 21 --------------------- .gitignore | 4 +++- .goreleaser.yaml | 25 +++++++++++++++++++++++++ .goreleaser.yml | 31 ------------------------------- 5 files changed, 54 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yaml delete mode 100644 .goreleaser.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..1d4fd2e --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,26 @@ +name: Go Release +on: + push: + branches: + - main + pull_request: +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ^1.22 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10e9b87..42ac572 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,24 +27,3 @@ jobs: run: | npm install -g typescript make test - - # goreleaser: - # runs-on: ubuntu-latest - # needs: [test] - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 - # - name: Set up Go - # uses: actions/setup-go@v3 - # with: - # go-version: 1.18 - # - name: Run GoReleaser - # uses: goreleaser/goreleaser-action@v2 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # version: latest - # args: release --rm-dist - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 59b127b..31c9eea 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ node_modules coverage dist/* tmp/ -*.touchfile \ No newline at end of file +*.touchfile +dist/ +.envrc \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..e69ced9 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,25 @@ +version: 1 +before: + hooks: + - go mod tidy + - make options +builds: +- env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: +- format: tar.gz + name_template: >- + {{ .ProjectName }}_ {{- title .Os }}_ {{- if eq .Arch "amd64" }}x86_64 {{- else if eq .Arch "386" }}i386 {{- else }}{{ .Arch }}{{ end }} {{- if .Arm }}v{{ .Arm }}{{ end }} + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^test:" diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 4b0e8f0..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This is an example .goreleaser.yml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com -before: - hooks: - # You may remove this if you don't use go modules. - - go mod tidy - # you may remove this if you don't need go generate - - go generate ./... -builds: - - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin -archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:'