-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated the workflow seperate build for wasm
- Loading branch information
1 parent
655c9ff
commit 227b488
Showing
1 changed file
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,25 +12,13 @@ jobs: | |
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,js] | ||
goarch: ["386", amd64, arm64,wasm] | ||
goos: [linux, windows, darwin] | ||
goarch: ["386", amd64, arm64] | ||
exclude: | ||
- goarch: "386" | ||
goos: darwin | ||
- goarch: arm64 | ||
goos: windows | ||
- goos: js | ||
goarch: "386" | ||
- goos: js | ||
goarch: arm64 | ||
- goos: js | ||
goarch: amd64 | ||
- goarch: wasm | ||
goos: windows | ||
- goarch: wasm | ||
goos: linux | ||
- goarch: wasm | ||
goos: darwin | ||
goos: windows | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: wangyoucao577/[email protected] | ||
|
@@ -42,7 +30,25 @@ jobs: | |
binary_name: "l2" | ||
extra_files: LICENSE README.md | ||
ldflags: -X main.version=${{ github.ref_name }} | ||
build_flags: | | ||
${{ matrix.goos == 'js' && matrix.goarch == 'wasm' && '-a -gcflags="all=-l -B -wb=false" -ldflags="-w -s"' || '-tags=cli' }} | ||
output_name: | | ||
${{ matrix.goos == 'js' && matrix.goarch == 'wasm' && 'main.wasm' }} | ||
build_flags: '-tags=cli' | ||
|
||
# Separate job for Wasm build | ||
wasm-build: | ||
permissions: write-all | ||
name: Build WebAssembly Binary | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: wangyoucao577/[email protected] | ||
with: | ||
go-version: "https://dl.google.com/go/go1.19.3.linux-amd64.tar.gz" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: js | ||
goarch: wasm | ||
goversion: "https://dl.google.com/go/go1.19.3.linux-amd64.tar.gz" | ||
binary_name: "l2.wasm" | ||
extra_files: LICENSE README.md | ||
ldflags: -X main.version=${{ github.ref_name }} | ||
build_flags: | | ||
${{ '-tags=wasm -a -gcflags="all=-l -B -wb=false" -ldflags="-w -s"' }} | ||