-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.27 KB
/
goinvaders.yml
File metadata and controls
35 lines (33 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: goinvaders
on: [push, workflow_dispatch]
jobs:
goinvaders:
runs-on: ubuntu-22.04
steps:
- name: Install Ebiten dependencies
run: |
sudo apt-get install -y \
libc6-dev libgl1-mesa-dev libxcursor-dev \
libxi-dev libxinerama-dev libxrandr-dev \
libxxf86vm-dev libasound2-dev pkg-config
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
- name: Test
run: go test ./...
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o goinvaders ./cmd/goinvaders/
GOOS=windows GOARCH=amd64 go build -o goinvaders.exe ./cmd/goinvaders/
GOOS=js GOARCH=wasm go build -o goinvaders.wasm ./cmd/goinvaders/
# Required to run the wasm file in the browser.
cp $(go env GOROOT)/misc/wasm/wasm_exec.js wasm_exec.js
- name: Release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: false
artifacts: "goinvaders,goinvaders.exe,goinvaders.wasm,wasm_exec.js"