From 69c30114518250bf4295e484c406a95da44167b9 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Tue, 3 Mar 2026 22:45:32 +0000 Subject: [PATCH] Add Forgejo CI: build workflow and tag-based release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .forgejo/workflows/build.yml | 98 +++++++++++++++++++++++++ .forgejo/workflows/release.yml | 128 +++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 .forgejo/workflows/build.yml create mode 100644 .forgejo/workflows/release.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..f7fdb97 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -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 diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..3421c26 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -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/