build.yml — runs on push/PR to main:
- build-linux: webkit2gtk-4.0 (Ubuntu 22.04 and earlier)
- build-linux-webkit2_41: webkit2gtk-4.1 (Ubuntu 24.04+)
Both run tests then produce a tarball artifact.
release.yml — runs on v* tags:
- Same two build jobs
- publish-release: collects both tarballs, creates a
Forgejo release with forgejo-release action
Co-authored-by: Shelley <shelley@exe.dev>
99 lines
2.3 KiB
YAML
99 lines
2.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y -qq \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.0-dev \
|
|
pkg-config \
|
|
build-essential
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
|
|
|
- name: Run tests
|
|
run: go test ./...
|
|
|
|
- name: Build
|
|
run: wails build -platform linux/amd64
|
|
|
|
- name: Package artifact
|
|
run: |
|
|
cd build/bin
|
|
tar czf ../../csvtool-linux-amd64.tar.gz csvtool
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: csvtool-linux-amd64
|
|
path: csvtool-linux-amd64.tar.gz
|
|
|
|
build-linux-webkit2_41:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install system dependencies (webkit2gtk-4.1)
|
|
run: |
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y -qq \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.1-dev \
|
|
pkg-config \
|
|
build-essential
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
|
|
|
- name: Run tests
|
|
run: go test -tags webkit2_41 ./...
|
|
|
|
- name: Build
|
|
run: wails build -tags webkit2_41 -platform linux/amd64
|
|
|
|
- name: Package artifact
|
|
run: |
|
|
cd build/bin
|
|
tar czf ../../csvtool-linux-amd64-webkit2_41.tar.gz csvtool
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: csvtool-linux-amd64-webkit2_41
|
|
path: csvtool-linux-amd64-webkit2_41.tar.gz
|