Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build Linux

on:
# manually trigger the workflow from the Actions tab
workflow_dispatch:
# validate the Linux packaging when its scripts change
pull_request:
paths:
- 'client/cmd/bisonw-desktop/linux/**'
- '.github/workflows/build-linux.yml'

permissions:
contents: read

jobs:
build-binary:
name: Native build (binary)
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
with:
fetch-depth: 0
fetch-tags: true

- name: Install deb deps
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 #v1.6.0
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential
version: 1.0

- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c #v6.1.0
with:
go-version: '1.24'
cache-dependency-path: |
go.sum
client/cmd/bisonw-desktop/go.sum

- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
with:
node-version: 22

- name: Build site bundle
working-directory: client/webserver/site
run: |
npm clean-install
npm run build

- name: Build binary
working-directory: client/cmd/bisonw-desktop
run: |
source linux/common.sh
mkdir -p build/linux
LDFLAGS="-s -w -X main.Version=${VER}${META:++${META}}"
GOOS=linux GOARCH=${ARCH} go build -o build/linux/bisonw-desktop -ldflags "$LDFLAGS"

- name: Upload binary
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: bisonw-desktop-linux-bin
if-no-files-found: error
path: client/cmd/bisonw-desktop/build/linux/bisonw-desktop

build-deb:
name: Debian package (.deb)
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
with:
fetch-depth: 0
fetch-tags: true

- name: Install deb deps
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 #v1.6.0
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential
version: 1.0

- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c #v6.1.0
with:
go-version: '1.24'
cache-dependency-path: |
go.sum
client/cmd/bisonw-desktop/go.sum

- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
with:
node-version: 22

# pkg-debian.sh builds the site bundle itself before compiling.
- name: Build deb package
working-directory: client/cmd/bisonw-desktop
run: linux/pkg-debian.sh

- name: Upload deb
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: bisonw-desktop-linux-deb
if-no-files-found: error
path: client/cmd/bisonw-desktop/build/*.deb
4 changes: 2 additions & 2 deletions .github/workflows/build-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:

- name: Build deb package
working-directory: client/cmd/bisonw-desktop
run: pkg/pkg-debian.sh
run: linux/pkg-debian.sh

- name: Prepare snapcraft.yml
working-directory: client/cmd/bisonw-desktop
run: pkg/prepare-snap.sh
run: linux/prepare-snap.sh

- name: Build snap package
uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
Expand Down
Loading