Add Forgejo CI: build workflow and tag-based release
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>
This commit is contained in:
parent
55a25f6d63
commit
69c3011451
98
.forgejo/workflows/build.yml
Normal file
98
.forgejo/workflows/build.yml
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
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
|
||||
128
.forgejo/workflows/release.yml
Normal file
128
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
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
|
||||
|
||||
publish-release:
|
||||
needs: [build-linux, build-linux-webkit2_41]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download linux artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: csvtool-linux-amd64
|
||||
path: artifacts/
|
||||
|
||||
- name: Download linux webkit2_41 artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: csvtool-linux-amd64-webkit2_41
|
||||
path: artifacts/
|
||||
|
||||
- name: Create release
|
||||
uses: actions/forgejo-release@v2
|
||||
with:
|
||||
direction: upload
|
||||
tag: ${{ github.ref_name }}
|
||||
title: ${{ github.ref_name }}
|
||||
release-notes: |
|
||||
## CSV Tool ${{ github.ref_name }}
|
||||
|
||||
### Artifacts
|
||||
|
||||
- **csvtool-linux-amd64.tar.gz** — Linux build (webkit2gtk-4.0)
|
||||
- **csvtool-linux-amd64-webkit2_41.tar.gz** — Linux build (webkit2gtk-4.1, for Ubuntu 24.04+)
|
||||
release-dir: artifacts/
|
||||
Loading…
Reference in a new issue