Merge pull request #198 from sedyh/master #356
This file contains hidden or 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: Go | |
on: | |
push: | |
branches: [ "master" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Update apt-get | |
run: sudo apt-get update | |
- name: Install xorg-dev | |
run: sudo apt-get install -y xorg-dev xvfb | |
- name: Install libgl1-mesa-dev | |
run: sudo apt-get install -y libgl1-mesa-dev | |
- name: Vet | |
run: go vet ./... | |
- name: Test | |
run: xvfb-run go test ./... | |
- name: Build | |
run: go build -v ./... | |
- name: Build Demo wasm | |
run: GOOS=js GOARCH=wasm go build -o ./wasm/demo.wasm ./_examples/demo | |
- name: Build examples | |
run: | | |
find ./_examples/widget_demos -maxdepth 1 -mindepth 1 -type d -exec bash -c 'NAME=$(basename "{}") && GOOS=js GOARCH=wasm go build -o ./wasm/$NAME.wasm {}' \; | |
ls ./wasm | |
- name: Deploy Examples to docs/wasm | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: ./wasm # The folder the action should deploy. | |
branch: master | |
target-folder: docs/wasm | |
repository-name: ebitenui/ebitenui.github.io | |
token: ${{ secrets.EBITENUI_TOKEN }} | |
- name: Deploy Examples to content/wasm | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: ./wasm # The folder the action should deploy. | |
branch: master | |
target-folder: content/wasm | |
repository-name: ebitenui/ebitenui.github.io | |
token: ${{ secrets.EBITENUI_TOKEN }} |