2023-06-26 03:43:33 +00:00
|
|
|
name: Build/Publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
- develop-*
|
2023-08-09 18:12:28 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
debug_enabled:
|
2023-08-09 18:16:59 +00:00
|
|
|
description: debug_enabled
|
2023-08-09 18:12:28 +00:00
|
|
|
type: boolean
|
2023-06-26 03:43:33 +00:00
|
|
|
jobs:
|
2023-06-26 03:59:23 +00:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18.x
|
|
|
|
cache: 'npm'
|
|
|
|
- name: Setup Golang
|
|
|
|
run: |
|
2023-08-09 18:58:55 +00:00
|
|
|
sudo apt-get update && sudo apt-get install bsdmainutils -y bison;
|
2023-08-09 18:12:28 +00:00
|
|
|
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer);
|
2023-08-09 18:57:20 +00:00
|
|
|
source ~/.gvm/scripts/gvm || true;
|
2023-06-26 03:59:23 +00:00
|
|
|
gvm install go1.4 -B;
|
|
|
|
gvm use go1.4 --default;
|
|
|
|
gvm install go1.19 -B;
|
|
|
|
VERSION=0.28.1;
|
|
|
|
TINYGO="tinygo_${VERSION}_amd64.deb";
|
2023-06-26 04:04:53 +00:00
|
|
|
wget -q https://github.com/tinygo-org/tinygo/releases/download/v$VERSION/$TINYGO;
|
2023-06-26 03:59:23 +00:00
|
|
|
sudo dpkg -i $TINYGO && rm $TINYGO;
|
|
|
|
- name: Fetch Wasm Deps
|
|
|
|
run: |
|
2023-08-09 19:09:56 +00:00
|
|
|
set -x
|
2023-08-09 19:00:36 +00:00
|
|
|
source ~/.gvm/scripts/gvm || true;
|
2023-08-09 19:30:12 +00:00
|
|
|
gvm use go1.19 --default || true;
|
2023-06-26 03:59:23 +00:00
|
|
|
cd src/golang;
|
|
|
|
go get;
|
2023-06-26 04:02:17 +00:00
|
|
|
- run: npm ci
|
|
|
|
- run: npm run build --if-present
|
|
|
|
- name: Install SSH key
|
|
|
|
uses: shimataro/ssh-key-action@v2
|
|
|
|
with:
|
|
|
|
key: ${{ secrets.GITEA_SSH_KEY }}
|
|
|
|
known_hosts: ${{ secrets.GITEA_KNOWN_HOST }}
|
|
|
|
|
2023-06-26 03:59:23 +00:00
|
|
|
- name: Publish
|
|
|
|
run: npm run semantic-release
|
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Setup tmate session
|
|
|
|
uses: mxschmitt/action-tmate@v3
|
|
|
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
|
|
|
|
with:
|
|
|
|
limit-access-to-actor: true
|