-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecd71c1
commit 03d65d0
Showing
6 changed files
with
186 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
.github | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Build and publish AppImages | ||
|
||
env: | ||
UBUNTU_RELEASE: jammy | ||
UBUNTU_PUBKEY: 871920D1991BC93C | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: main | ||
release: | ||
types: published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: rlespinasse/github-slug-action@v4 | ||
|
||
- name: Setup qemu for docker | ||
uses: docker/setup-qemu-action@v2 | ||
if: matrix.platform != 'linux/amd64' | ||
|
||
- name: Setup buildx for docker | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Compile in docker | ||
uses: docker/build-push-action@v4 | ||
with: | ||
platforms: ${{ matrix.platform }} | ||
outputs: build | ||
build-args: | | ||
UBUNTU_RELEASE | ||
- name: Prepare environment for building AppImage | ||
env: | ||
TARGET_PLATFORM: ${{ matrix.platform }} | ||
shell: bash | ||
run: | | ||
set -eua | ||
. build/.build-metadata.env | ||
rm build/.build-metadata.env | ||
APPIMAGE_SOURCE=build | ||
APPIMAGE_VERSION="${GITHUB_REF_SLUG}" | ||
APPIMAGE_APT_ARCH="${TARGETARCH}" | ||
APPIMAGE_APT_DISTRO="${UBUNTU_RELEASE}" | ||
APPIMAGE_APT_PUBKEY="${UBUNTU_PUBKEY}" | ||
APPIMAGE_ARCH="${TARGETMACHINE}" | ||
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}" | ||
- name: Build AppImage | ||
uses: AppImageCrafters/build-appimage@v1.3 | ||
with: | ||
recipe: dist/AppImageBuilder.yml | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: appimages | ||
path: | | ||
./*.AppImage | ||
./*.AppImage.zsync | ||
if-no-files-found: error | ||
|
||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- build | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: appimages | ||
path: assets | ||
- name: Create checksum for release assets | ||
shell: bash | ||
run: | | ||
algo="${SHA_ALGORITHM:-256}" | ||
find assets -type f | while read -r asset; do | ||
shasum --binary --algorithm "${algo}" "${asset}" >"${asset}.sha${algo}" | ||
done | ||
- name: Upload artifacts to GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: assets/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ARG UBUNTU_RELEASE=jammy | ||
|
||
FROM ubuntu:$UBUNTU_RELEASE AS build-stage | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
git ca-certificates build-essential libudev-dev zlib1g-dev valac libgee-0.8-dev meson | ||
|
||
COPY . / | ||
|
||
ARG BUILD_TYPE=release | ||
ARG ENABLE_LTO=true | ||
ARG TARGETOS TARGETARCH TARGETVARIANT | ||
|
||
RUN meson setup \ | ||
--fatal-meson-warnings \ | ||
"--buildtype=${BUILD_TYPE}" \ | ||
"-Db_lto=${ENABLE_LTO}" \ | ||
--prefix=/usr \ | ||
/build && \ | ||
meson compile -C /build && \ | ||
meson install --destdir=/release -C /build | ||
|
||
RUN export "TARGETMACHINE=$(uname -m)" && \ | ||
printenv | grep ^TARGET >>/release/.build-metadata.env | ||
|
||
FROM scratch AS export-stage | ||
COPY --from=build-stage /release/ /release/.build-metadata.env / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
version: 1 | ||
|
||
script: | ||
- | | ||
mv "{{APPIMAGE_SOURCE}}" "${TARGET_APPDIR}" | ||
icon_path="${TARGET_APPDIR}/usr/share/icons/hicolor/128x128/apps" | ||
mkdir -p "${icon_path}" | ||
cp -a dist/linuxmotehook2.png "${icon_path}" | ||
# Manual installation is required until fix of https://github.com/AppImageCrafters/build-appimage/issues/5 | ||
if ! command -v mksquashfs >/dev/null; then | ||
apt-get update && apt-get install -y --no-install-recommends squashfs-tools | ||
fi | ||
AppDir: | ||
app_info: | ||
id: org.v1993.linuxmotehook2 | ||
name: linuxmotehook2 | ||
version: "{{APPIMAGE_VERSION}}" | ||
icon: linuxmotehook2 | ||
exec: usr/bin/linuxmotehook2 | ||
exec_args: $@ | ||
|
||
after_runtime: | | ||
echo "X-AppImage-Integrate=false" >> "${TARGET_APPDIR}/org.v1993.linuxmotehook2.desktop" | ||
apt: | ||
arch: | ||
- "{{APPIMAGE_APT_ARCH}}" | ||
sources: | ||
- sourceline: deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ "{{APPIMAGE_APT_DISTRO}}" main | ||
key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{APPIMAGE_APT_PUBKEY}}" | ||
- sourceline: deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ "{{APPIMAGE_APT_DISTRO}}"-updates main | ||
- sourceline: deb [arch=amd64] http://security.ubuntu.com/ubuntu/ "{{APPIMAGE_APT_DISTRO}}"-security main | ||
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ "{{APPIMAGE_APT_DISTRO}}" main | ||
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ "{{APPIMAGE_APT_DISTRO}}"-updates main | ||
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ "{{APPIMAGE_APT_DISTRO}}"-security main | ||
include: | ||
- libudev1 | ||
- libglib2.0-0 | ||
- libgee-0.8-2 | ||
|
||
files: | ||
exclude: | ||
- usr/share/man | ||
- usr/share/doc/*/README.* | ||
- usr/share/doc/*/changelog.* | ||
- usr/share/doc/*/NEWS.* | ||
- usr/share/doc/*/TODO.* | ||
- usr/share/lintian | ||
- usr/lib/*/glib-2.0 | ||
|
||
AppImage: | ||
arch: "{{APPIMAGE_ARCH}}" | ||
update-information: "gh-releases-zsync|v1993|linuxmotehook2|latest|linuxmotehook2-*-{{APPIMAGE_ARCH}}.AppImage.zsync" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.