Skip to content

Commit

Permalink
Merge pull request #1146 from darkdragon-001/flatpak
Browse files Browse the repository at this point in the history
Fix Flatpak build
  • Loading branch information
nanu-c authored Jan 23, 2024
2 parents e21309c + 5daf132 commit 48dc80a
Show file tree
Hide file tree
Showing 31 changed files with 22,536 additions and 4,577 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,37 @@ jobs:
name: build-axolotl-linux-arm64
path: target/aarch64-unknown-linux-gnu/release/axolotl
retention-days: 1

# See https://github.com/flatpak/flatpak-github-actionsfor examples
flatpak:
name: Flatpak
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-45
options: --privileged
strategy:
matrix:
arch: [x86_64, aarch64]
# Don't fail the whole workflow if one architecture fails
fail-fast: false
steps:
- uses: actions/checkout@v4
# Docker is required by the docker/setup-qemu-action which enables emulation
- name: Install deps
if: ${{ matrix.arch != 'x86_64' }}
run: |
dnf -y install docker
- name: Set up QEMU
if: ${{ matrix.arch != 'x86_64' }}
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: axolotl.flatpak
manifest-path: flatpak/org.nanuc.Axolotl.yml
branch: ${{ github.head_ref || github.ref_name }}
arch: ${{ matrix.arch }}
build-bundle: true
upload-artifact: true
19 changes: 0 additions & 19 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,6 @@ jobs:
path: build/*/app/axolotl.nanuc_*.click
retention-days: 1

# package-flatpak-web:
# name: Package as Flatpak web bundle
# runs-on: ubuntu-latest
# container:
# image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
# options: --privileged

# steps:
# - name: Check out code
# uses: actions/checkout@v3

# - name: Build Flatpak Web version
# uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v5
# with:
# bundle: axolotl-web.flatpak
# manifest-path: flatpak/web/org.nanuc.Axolotl.yml
# cache-key: flatpak-builder-web-${{ github.sha }}
# branch: ${{ github.ref_name }}

package-deb-arm64:
name: Package as Debian arm64
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ gopath/*
main

output
bind*.go
*.syso
dist
.flatpak-builder
Expand All @@ -31,4 +30,5 @@ rustc-ice*.txt

/target
/bin
.vscode/*
.devcontainer/
.vscode/
35 changes: 1 addition & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ presage = { git = "https://github.com/nanu-c/presage", rev = "fbb1ad6e7c5bfe5d57
presage-store-sled = { git = "https://github.com/nanu-c/presage", rev = "fbb1ad6e7c5bfe5d57bd78111c6689583750a6cd" }
#presage = {path = "../presage/presage"}
#presage-store-sled = { path = "../presage/presage-store-sled" }
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "a36d43d62" }
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "0a7987e" }
zeroize = { version = "1.6.0", default-features = false }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
tokio-stream = "0.1.12"
Expand Down
37 changes: 9 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the Makefile for axolotl.
# For more info about the syntax, see https://makefiletutorial.com/

.PHONY: build clean build-axolotl-web build-axolotl install install-axolotl install-axolotl-web uninstall build-translation run check check-axolotl check-axolotl-web build-dependencies build-dependencies-axolotl-web build-dependencies-axolotl update-version build-dependencies-flatpak build-dependencies-flatpak-web build-dependencies-flatpak-qt install-flatpak-web install-flatpak-qt build-snap install-snap check-platform-deb-arm64 dependencies-deb-arm64 build-deb-arm64 prebuild-package-deb-arm64 build-package-deb-arm64 install-deb-arm64 uninstall-deb-arm64 check-platform-deb-arm64-cc dependencies-deb-arm64-cc build-deb-arm64-cc prebuild-package-deb-arm64-cc build-package-deb-arm64-cc clean-deb-arm64 package-clean-deb-arm64 uninstall-deb-dependencies-cc
.PHONY: build clean build-axolotl-web build-axolotl install install-axolotl install-axolotl-web uninstall build-translation run check check-axolotl check-axolotl-web build-dependencies build-dependencies-axolotl-web build-dependencies-axolotl update-version build-dependencies-flatpak install-flatpak build-snap install-snap check-platform-deb-arm64 dependencies-deb-arm64 build-deb-arm64 prebuild-package-deb-arm64 build-package-deb-arm64 install-deb-arm64 uninstall-deb-arm64 check-platform-deb-arm64-cc dependencies-deb-arm64-cc build-deb-arm64-cc prebuild-package-deb-arm64-cc build-package-deb-arm64-cc clean-deb-arm64 package-clean-deb-arm64 uninstall-deb-dependencies-cc

NPM_VERSION := $(shell npm --version 2>/dev/null)
NODE_VERSION := $(shell node --version 2>/dev/null)
Expand Down Expand Up @@ -109,7 +109,6 @@ ifeq ($(NEW_VERSION),)
else
@echo "Replacing current version $(AXOLOTL_VERSION) with new version $(NEW_VERSION)"
@sed -i 's/$(AXOLOTL_VERSION)/$(NEW_VERSION)/' manifest.json
@sed -i 's/$(AXOLOTL_VERSION)/$(NEW_VERSION)/' app/config/config.go
@sed -i 's/$(AXOLOTL_VERSION)/$(NEW_VERSION)/' snap/snapcraft.yaml
@sed -i 's/$(AXOLOTL_VERSION)/$(NEW_VERSION)/' docs/INSTALL.md
@sed -i "32i $$APPDATA_TEXT" appimage/AppDir/axolotl.appdata.xml
Expand All @@ -131,37 +130,19 @@ install-axolotl-electron-bundle:

## Flatpak
build-dependencies-flatpak:
$(FLATPAK) install org.freedesktop.Sdk.Extension.golang//22.08
$(FLATPAK) install org.gnome.Platform//45
$(FLATPAK) install org.gnome.Sdk//45
$(FLATPAK) install org.freedesktop.Sdk.Extension.node18//22.08
$(FLATPAK) install org.freedesktop.Sdk.Extension.rust-stable//22.08

build-dependencies-flatpak-web: build-dependencies-flatpak
$(FLATPAK) install org.freedesktop.Platform//22.08
$(FLATPAK) install org.freedesktop.Sdk//22.08
$(FLATPAK) install org.electronjs.Electron2.BaseApp//22.08
build-flatpak:
$(FLATPAK_BUILDER) flatpak/build --force-clean --ccache flatpak/org.nanuc.Axolotl.yml

build-dependencies-flatpak-qt: build-dependencies-flatpak
$(FLATPAK) install org.kde.Platform//5.15-22.08
$(FLATPAK) install org.kde.Sdk//5.15-22.08
$(FLATPAK) install io.qt.qtwebengine.BaseApp//5.15-22.08
install-flatpak:
$(FLATPAK_BUILDER) flatpak/build --force-clean --user --install flatpak/org.nanuc.Axolotl.yml

build-flatpak-web:
$(FLATPAK_BUILDER) flatpak/build --verbose --force-clean --ccache flatpak/web/org.nanuc.Axolotl.yml

build-flatpak-qt:
$(FLATPAK_BUILDER) flatpak/build --verbose --force-clean --ccache flatpak/qt/org.nanuc.Axolotl.yml

install-flatpak-web:
$(FLATPAK_BUILDER) --user --install --force-clean flatpak/build flatpak/web/org.nanuc.Axolotl.yml

install-flatpak-qt:
$(FLATPAK_BUILDER) --user --install --force-clean flatpak/build flatpak/qt/org.nanuc.Axolotl.yml

debug-flatpak-web:
$(FLATPAK_BUILDER) --run --verbose flatpak/build flatpak/web/org.nanuc.Axolotl.yml sh

debug-flatpak-qt:
$(FLATPAK_BUILDER) --run --verbose flatpak/build flatpak/qt/org.nanuc.Axolotl.yml sh
debug-flatpak:
$(FLATPAK_BUILDER) flatpak/build --run --verbose flatpak/org.nanuc.Axolotl.yml sh

uninstall-flatpak:
$(FLATPAK) uninstall org.nanuc.Axolotl
Expand Down
7 changes: 0 additions & 7 deletions appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ do
fi
done

echo "build axolotl"
pushd ../
go clean
go mod download -x
go build -v
popd

echo "build axolotl-web"
pushd ../axolotl-web
npm ci
Expand Down
4 changes: 2 additions & 2 deletions axolotl-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48dc80a

Please sign in to comment.