Skip to content

Commit

Permalink
add two release jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero committed Sep 27, 2022
1 parent f5e382d commit 3aec3f6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 17 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,28 @@ jobs:
- name: Run e2e tests
shell: bash
run: scripts/tests.e2e.sh 1.8.0 1.8.1 0.3.0
release:
release-darwin:
needs: [lint_test, unit_test, e2e_test]
runs-on: macos-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist --config .goreleaser-darwin.yml
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-linux:
needs: [lint_test, unit_test, e2e_test]
runs-on: ubuntu-latest
steps:
Expand All @@ -72,7 +93,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --rm-dist --config .goreleaser-linux.yml
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 7 additions & 10 deletions .goreleaser.yml → .goreleaser-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ builds:
- -v
ldflags:
- -X 'github.com/ava-labs/avalanche-network-runner/cmd.Version={{.Version}}'
ignore:
- goos: darwin
goarch: 386
- goos: linux
goarch: 386
- goos: windows
goarch: 386
- goos: freebsd
goarch: 386

goos:
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
Expand Down
22 changes: 22 additions & 0 deletions .goreleaser-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ref. https://goreleaser.com/customization/build/
builds:
- id: avalanche-network-runner
main: ./main.go
binary: avalanche-network-runner
flags:
- -v
ldflags:
- -X 'github.com/ava-labs/avalanche-network-runner/cmd.Version={{.Version}}'
goos:
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
github:
owner: ava-labs
name: avalanche-network-runner
7 changes: 2 additions & 5 deletions scripts/build.release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ go install -v github.com/goreleaser/goreleaser@latest

# e.g.,
# git tag 1.0.0
goreleaser release \
--config .goreleaser.yml \
--skip-announce \
--skip-publish
#goreleaser release --config .goreleaser.yml --skip-announce --skip-publish

# to test without git tags
# goreleaser release --config .goreleaser.yml --rm-dist --skip-announce --skip-publish --snapshot
goreleaser release --config .goreleaser.yml --rm-dist --skip-announce --skip-publish --snapshot

0 comments on commit 3aec3f6

Please sign in to comment.