Skip to content

Commit

Permalink
Merge branch 'main' into terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 13, 2025
2 parents 57b9847 + 9e63da1 commit 6a96f3f
Show file tree
Hide file tree
Showing 177 changed files with 7,542 additions and 2,319 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libolm-dev libolm3 libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
Expand Down
99 changes: 98 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
stages:
- frontend
- build
- build desktop
- docker

default:
Expand Down Expand Up @@ -39,7 +40,7 @@ frontend:
- export MAUTRIX_VERSION=$(cat go.mod | grep 'maunium.net/go/mautrix ' | awk '{ print $2 }')
- export GO_LDFLAGS="-s -w -linkmode external -extldflags -static -X go.mau.fi/gomuks/version.Tag=$CI_COMMIT_TAG -X go.mau.fi/gomuks/version.Commit=$CI_COMMIT_SHA -X 'go.mau.fi/gomuks/version.BuildTime=`date -Iseconds`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'"
script:
- go build -ldflags "$GO_LDFLAGS" -o gomuks ./cmd/gomuks
- go build -ldflags "$GO_LDFLAGS" ./cmd/gomuks
artifacts:
paths:
- gomuks
Expand Down Expand Up @@ -81,6 +82,16 @@ linux/arm64:
- linux
- arm64

windows/amd64:
<<: *build-linux
image: dock.mau.dev/tulir/gomuks-build-docker:windows-amd64
artifacts:
paths:
- gomuks.exe
tags:
- linux
- amd64

macos/arm64:
stage: build
tags:
Expand Down Expand Up @@ -154,3 +165,89 @@ docker/manifest:
docker manifest create $MANIFEST_NAME $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-amd64 $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-arm64
docker manifest push $MANIFEST_NAME
- docker rmi $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-amd64 $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA-arm64

.build-desktop: &build-desktop
stage: build desktop
cache:
paths:
- .cache
before_script:
- mkdir -p .cache
- export GOPATH="$CI_PROJECT_DIR/.cache"
- export GOCACHE="$CI_PROJECT_DIR/.cache/build"
script:
- cd desktop
- wails3 task $PLATFORM:package
- ls bin
artifacts:
paths:
- desktop/bin/*
dependencies:
- frontend
needs:
- frontend

desktop/linux/amd64:
<<: *build-desktop
image: dock.mau.dev/tulir/gomuks-build-docker/wails:linux-amd64
variables:
PLATFORM: linux
after_script:
- mv desktop/bin/gomuks-desktop .
- mv desktop/build/nfpm/bin/gomuks-desktop.deb .
artifacts:
paths:
- gomuks-desktop
- gomuks-desktop.deb
tags:
- linux
- amd64

desktop/linux/arm64:
<<: *build-desktop
image: dock.mau.dev/tulir/gomuks-build-docker/wails:linux-arm64-native
variables:
PLATFORM: linux
after_script:
- mv desktop/bin/gomuks-desktop .
- mv desktop/build/nfpm/bin/gomuks-desktop.deb .
artifacts:
paths:
- gomuks-desktop
- gomuks-desktop.deb
tags:
- linux
- arm64

desktop/windows/amd64:
<<: *build-desktop
image: dock.mau.dev/tulir/gomuks-build-docker/wails:windows-amd64
after_script:
- mv desktop/bin/gomuks-desktop.exe .
artifacts:
paths:
- gomuks-desktop.exe
variables:
PLATFORM: windows

desktop/macos/arm64:
<<: *build-desktop
cache: {}
before_script:
- export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
- export LIBRARY_PATH=$(brew --prefix)/lib
- export CPATH=$(brew --prefix)/include
after_script:
- hdiutil create -srcFolder ./desktop/bin/gomuks-desktop.app/ -o ./gomuks-desktop.dmg
- codesign -s - --timestamp -i fi.mau.gomuks.desktop.mac gomuks-desktop.dmg
- mv desktop/bin/gomuks-desktop .
artifacts:
paths:
- gomuks-desktop
# TODO generate proper dmgs
#- gomuks-desktop.dmg
variables:
PLATFORM: darwin
tags:
- macos
- arm64
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: go-staticcheck-repo-mod

- repo: https://github.com/beeper/pre-commit-go
rev: v0.3.1
rev: v0.4.2
hooks:
- id: prevent-literal-http-methods

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20
FROM alpine:3.21

RUN apk add --no-cache ca-certificates jq curl

Expand Down
1 change: 1 addition & 0 deletions desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.task
bin
build/appimage
Loading

0 comments on commit 6a96f3f

Please sign in to comment.