Skip to content

Commit

Permalink
feat: github action for cross-compiling releases
Browse files Browse the repository at this point in the history
  • Loading branch information
tormodatt authored and tombh committed Jul 1, 2022
1 parent 094d7b8 commit 8d321c4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ jobs:
GOBIN: ${{ github.workspace }}/bin
steps:
- name: Checkout
uses: actions/checkout@main
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Install go-bindata
run: go install github.com/kevinburke/go-bindata/go-bindata@latest
- name: Build
- name: Pre-build
run: ./interfacer/contrib/build_browsh.sh
- name: Build
working-directory: ./interfacer
run: go build ./cmd/browsh
- name: Test
run: ./interfacer/browsh --version

30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Browsh
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/[email protected]
with:
pre_command: "./interfacer/contrib/build_browsh.sh"
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.18
project_path: "./interfacer/cmd/browsh"
binary_name: "browsh"
extra_files: LICENSE README.md
2 changes: 1 addition & 1 deletion interfacer/contrib/build_browsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ XPI_FILE=$xpi_file BIN_FILE=$destination \
$INTERFACER_ROOT/contrib/xpi2bin.sh

# The actual build iteself
go build ./cmd/browsh
# go build ./cmd/browsh

0 comments on commit 8d321c4

Please sign in to comment.