Add AppImage builder workflow #2
Workflow file for this run
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
name: Build and publish AppImages | |
env: | |
UBUNTU_RELEASE: jammy | |
UBUNTU_PUBKEY: 871920D1991BC93C | |
on: | |
push: | |
pull_request: | |
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 -eu | |
find build -mindepth 1 -maxdepth 1 -type d | while read -r path; do | |
set -a | |
APPIMAGE_PATH="${path}" | |
APPIMAGE_VERSION="${GITHUB_REF_SLUG}" | |
APPIMAGE_APT_ARCH="${TARGET_PLATFORM#*/}" | |
APPIMAGE_APT_DISTRO="${UBUNTU_RELEASE}" | |
APPIMAGE_APT_PUBKEY="${UBUNTU_PUBKEY}" | |
APPIMAGE_ARCH="$(basename "${path}")" | |
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}" | |
done | |
- name: Build AppImage | |
uses: AppImageCrafters/build-appimage@v1 | |
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/* |