This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
Update main.go #27
Workflow file for this run
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
name: Webassembly library Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest] | |
build_type: [Release] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '^1.21.1' | |
- name: Create build folder | |
run: | | |
mkdir ${{ github.workspace }}/build | |
mkdir ${{ github.workspace }}/build/wasm | |
- name: Build Webassembly library | |
run: | | |
export CGO_ENABLED=1 | |
export GOOS=js | |
export GOARCH=wasm | |
go build -o ${{ github.workspace }}/build/wasm/libgodp.wasm ${{ github.workspace }}/wasm/web/main.go | |
- name: Check Files | |
run: ls ${{ github.workspace }}/build | |
- name: Create Release | |
run: | | |
cd ${{ github.workspace }}/build/wasm && tar -czf ${{ github.workspace }}/build/webassembly-wasm.tar.gz . | |
sha256sum ${{ github.workspace }}/build/webassembly-wasm.tar.gz >${{ github.workspace }}/build/webassembly-wasm.txt | |
- name: Check Release Files | |
run: | | |
ls ${{ github.workspace }}/build/webassembly-*.* | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: webassembly-library-release | |
path: | | |
${{ github.workspace }}/build/*.* | |
- name: release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: "build/*.gz,build/*.txt" |