Skip to content

Commit

Permalink
feat: add goreleaser to publish binaries (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain authored Aug 23, 2024
1 parent f1aa5ae commit cd5cb37
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
with:
node-version: '20'

- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Validate Tag
run: |
node -e "if (!/^v\d+\.\d+\.\d+$/.test('${{ github.ref_name }}')) { console.error('Invalid version provided');process.exit(1);}"
Expand All @@ -44,6 +48,14 @@ jobs:
exit 1
fi
- name: Publish Binaries
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean --timeout=90m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-docker-image:
name: Publish Docker Image
uses: ./.github/workflows/publish-docker-images.yaml
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ package.json
coverage.out

.idea

dist/
47 changes: 47 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# goreleaser is currently used to attach binaries to github releases
# it can be exteneded in the future to also publish docker images, brew, chocolatey, etc.
version: 2

before:
hooks:
- go mod tidy
- go mod vendor

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: ./cmd/thor/main.go
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
main: ./cmd/disco/main.go
command: make disco

release:
github:
owner: vechain
name: thor

archives:
- format: tar.gz
wrap_in_directory: true
format_overrides:
- goos: windows
format: zip
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
files:
- LICENSE
- README.md

0 comments on commit cd5cb37

Please sign in to comment.