test new github workflow

This commit is contained in:
crgimenes
2023-02-13 17:46:25 -03:00
parent dbd6ed00ae
commit 6b451b0224

View File

@@ -1,218 +1,115 @@
name: Build Executables name: Build Executables
on: [push] on: [push]
jobs: jobs:
tests: tests:
name: Run tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version: 1.19
- name: Install dependencies - name: Install dependencies
shell: bash shell: bash
run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-dev xorg-dev libasound2-dev run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-dev xorg-dev libasound2-dev
- name: Run tests - name: Run tests
shell: bash shell: bash
run: xvfb-run go test -v ./... run: xvfb-run go test -v ./...
build-win: build-win:
name: Build Windows binary name: Build Windows binary
needs: tests needs: tests
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version: 1.19
- name: Build Windows exe - name: Build Windows exe
shell: bash shell: bash
run: go build run: go build
- name: Upload Windows exe - name: Upload Windows exe
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: neko-win name: neko-win
path: | path: |
LICENSE LICENSE
neko.exe neko.exe
build-mac: build-mac:
name: Build MacOS binary name: Build MacOS binary
needs: tests needs: tests
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version: 1.19
- name: Build Mac exe - name: Build Mac exe
shell: bash shell: bash
run: go build run: go build
- name: Tar it up - name: Tar it up
shell: bash shell: bash
run: tar -zcvf neko-mac.tar.gz neko LICENSE run: tar -zcvf neko-mac.tar.gz neko LICENSE
- name: Upload Mac exe - name: Upload Mac exe
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: neko-mac name: neko-mac
path: neko-mac.tar.gz path: neko-mac.tar.gz
build-lin: build-lin:
name: Build Linux binary name: Build Linux binary
needs: tests needs: tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: 1.19 go-version: 1.19
- name: Install dependencies - name: Install dependencies
shell: bash shell: bash
run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-dev xorg-dev libasound2-dev run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-dev xorg-dev libasound2-dev
- name: Build Linux exe - name: Build Linux exe
shell: bash shell: bash
run: go build -v run: go build -v
- name: Tar it up - name: Tar it up
shell: bash shell: bash
run: tar -zcvf neko-lin.tar.gz neko LICENSE run: tar -zcvf neko-lin.tar.gz neko LICENSE
- name: Upload Linux exe - name: Upload Linux exe
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: neko-lin name: neko-lin
path: neko-lin.tar.gz path: neko-lin.tar.gz
build-web:
name: Build Web binary
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build Web binary
shell: bash
run: GOOS=js GOARCH=wasm go build -v -ldflags "-w -s" -o dist/web/neko.wasm
- name: Copy WASM exec script
shell: bash
run: cp $(go env GOROOT)/misc/wasm/wasm_exec.js dist/web/.
- name: Upload Web build
uses: actions/upload-artifact@v3
with:
name: neko-web
path: |
dist/web/
LICENSE
upload-bundle: upload-bundle:
name: Bundle binaries with dev assets name: Bundle binaries with dev assets
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build-lin, build-mac, build-win] needs: [build-lin, build-mac, build-win]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Download Windows binary - name: Download Windows binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: neko-win name: neko-win
- name: Download Linux binary - name: Download Linux binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: neko-lin name: neko-lin
- name: Download Mac binary - name: Download Mac binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: neko-mac name: neko-mac
- name: Upload beta testing bundle - name: Upload beta testing bundle
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: neko-bundle name: neko-bundle
path: | path: |
README.md README.md
LICENSE LICENSE
neko-lin.tar.gz neko-lin.tar.gz
neko-mac.tar.gz neko-mac.tar.gz
neko.exe neko.exe
deploy-win:
name: Deploy Windows build to itch.io
if: startsWith(github.event.ref, 'refs/tags/v')
needs: build-win
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: neko-win
- uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: windows
ITCH_GAME: neko
ITCH_USER: sinisterstuf
PACKAGE: neko.exe
VERSION: ${{github.ref_name}}
deploy-mac:
name: Deploy MacOs build to itch.io
if: startsWith(github.event.ref, 'refs/tags/v')
needs: build-mac
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: neko-mac
- name: Extract tarball
shell: bash
run: tar -zxvf neko-mac.tar.gz
- uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: mac
ITCH_GAME: neko
ITCH_USER: sinisterstuf
PACKAGE: neko
VERSION: ${{github.ref_name}}
deploy-lin:
name: Deploy Linux build to itch.io
if: startsWith(github.event.ref, 'refs/tags/v')
needs: build-lin
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: neko-lin
- name: Extract tarball
shell: bash
run: tar -zxvf neko-lin.tar.gz
- uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux
ITCH_GAME: neko
ITCH_USER: sinisterstuf
PACKAGE: neko
VERSION: ${{github.ref_name}}
deploy-web:
name: Deploy Web build to itch.io
if: startsWith(github.event.ref, 'refs/tags/v')
needs: build-web
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: neko-web
- uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: web
ITCH_GAME: neko
ITCH_USER: sinisterstuf
PACKAGE: dist/web
VERSION: ${{github.ref_name}}