Skip to content

Commit

Permalink
CI: minor tweaks
Browse files Browse the repository at this point in the history
I like newlines and naming things
  • Loading branch information
v1993 committed Sep 6, 2023
1 parent c2b960e commit acbc937
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 20 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/release.yml → .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,34 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
platform:
- linux/amd64
- linux/arm64

steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
- uses: rlespinasse/github-slug-action@v4

- name: Setup qemu for docker
uses: docker/setup-qemu-action@v2
if: matrix.platform != 'linux/amd64'
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4

- 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
- uses: rlespinasse/github-slug-action@v4
- name: Prepare AppImage build
- name: Prepare environment for building AppImage
env:
TARGET_PLATFORM: ${{ matrix.platform }}
shell: bash
Expand All @@ -45,24 +54,34 @@ jobs:
APPIMAGE_ARCH="$(basename "${path}")"
printenv | grep ^APPIMAGE_ >>"${GITHUB_ENV}"
done
- uses: AppImageCrafters/build-appimage@v1
- name: Build AppImage
uses: AppImageCrafters/build-appimage@v1
with:
recipe: dist/AppImageBuilder.yml
- uses: actions/upload-artifact@v3

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: appimages
path: ./*.AppImage*
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:
- uses: actions/download-artifact@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: appimages
path: assets
Expand All @@ -73,6 +92,7 @@ jobs:
find assets -type f | while read -r asset; do
shasum --binary --algorithm "${algo}" "${asset}" >"${asset}.sha${algo}"
done
- uses: softprops/action-gh-release@v1
- name: Upload artifacts to GitHub release
uses: softprops/action-gh-release@v1
with:
files: assets/*
8 changes: 2 additions & 6 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Meson
name: Native build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
# Customize the Meson build type here (plain, debug, debugoptimized, release, minsize, custom)
Expand All @@ -16,9 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/checkout@v4

- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
Expand Down
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
ARG UBUNTU_RELEASE=jammy

ARG BUILD_TYPE=release
ARG ENABLE_LTO=true

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 libevdev-dev zlib1g-dev valac libgee-0.8-dev meson

COPY . /
ARG BUILD_TYPE=release
ARG ENABLE_LTO=true

RUN meson setup \
"--fatal-meson-warnings" \
"--buildtype=${BUILD_TYPE}" \
"-Db_lto=${ENABLE_LTO}" \
"--prefix=/usr" \
/build && \
meson compile -C /build && \
meson install "--destdir=/release/$(uname -m)" -C /build
meson install --destdir="/release/$(uname -m)" -C /build

FROM scratch AS export-stage

COPY --from=build-stage /release/ /

0 comments on commit acbc937

Please sign in to comment.