Repository navigation
114 lines (111 loc) · 5.09 KB
/
Copy pathrelease-linux.yml
File metadata and controls
114 lines (111 loc) · 5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release · Linux
on:
workflow_call:
inputs:
source-sha:
required: true
type: string
arch:
description: arm64 or x64
required: true
type: string
permissions:
contents: read
jobs:
build:
# Each architecture is built and packaged on a runner of its own kind, never cross-compiled.
runs-on: ${{ inputs.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
timeout-minutes: 60
env:
CARGO_INCREMENTAL: 0
ARCH: ${{ inputs.arch }}
PLATFORM: linux-${{ inputs.arch }}
TARGET: ${{ inputs.arch == 'arm64' && 'aarch64-unknown-linux-gnu' || 'x86_64-unknown-linux-gnu' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.sha }}
- name: Validate architecture
run: '[[ "$ARCH" == arm64 || "$ARCH" == x64 ]]'
- uses: ./.github/actions/build-setup
with:
target: ${{ env.TARGET }}
source-sha: ${{ inputs.source-sha }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxi-dev libxcursor-dev libxrandr-dev desktop-file-utils squashfs-tools patchelf
- name: Configure build
env:
WINC_UPDATE_PRIVATE_KEY: ${{ secrets.WINC_UPDATE_PRIVATE_KEY }}
run: |
node release/common/config.mjs --output "$RUNNER_TEMP/build-config.json"
# Compiled against the oldest supported glibc (release/linux/baseline.env), not the runner's.
- name: Compile
run: |
bash release/linux/baseline.sh cargo build --release --locked --target "$TARGET" -p winc -p winc-pty
bash release/linux/baseline.sh cargo xtask icons "target/$TARGET/release/bundle/icons"
- name: Verify glibc baseline
run: bash release/linux/verify-baseline.sh "target/$TARGET/release/winc" "target/$TARGET/release/winc-pty"
# The remote server runs on Linux hosts whatever system this package is for. It is static and
# has no C code, so the linker bundled with Rust builds every architecture on any runner.
- name: Compile remote server
run: bash release/linux/baseline.sh cargo xtask server
# Arch Linux itself is x86_64 only.
- name: Bundle and verify Arch package
if: inputs.arch == 'x64'
run: bash release/linux/arch/package.sh "$TARGET"
- name: Bundle and verify RPM package
run: bash release/linux/rpm/package.sh "$TARGET"
- name: Prepare native packaging tools
env:
GITHUB_TOKEN: ${{ github.token }}
run: node release/linux/download-tools.mjs
- name: Bundle deb and AppImage
env:
LINUXDEPLOY_DEBUG_LOG: ${{ runner.temp }}/linuxdeploy.log
WINC_UPDATE_PRIVATE_KEY: ${{ secrets.WINC_UPDATE_PRIVATE_KEY }}
run: |
bash release/linux/package.sh "$TARGET"
node release/common/sign-updates.mjs --platform "$PLATFORM" --bundle "target/$TARGET/release/bundle"
bash release/linux/baseline.sh cargo test --locked -p winc-app updates::tests::release_appcast_matches_packages -- --ignored
- name: Show linuxdeploy log
if: always()
run: cat "$RUNNER_TEMP/linuxdeploy.log" 2>/dev/null || echo "(no linuxdeploy log)"
- name: Verify AppImage
run: |
shopt -s nullglob
images=(target/"$TARGET"/release/bundle/appimage/*.AppImage)
((${#images[@]} == 1)) || { echo "::error::expected one AppImage"; exit 1; }
workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT
(cd "$workdir" && "$GITHUB_WORKSPACE/${images[0]}" --appimage-extract >/dev/null 2>&1)
test -d "$workdir/squashfs-root/usr/lib"
test -f "$workdir/squashfs-root/usr/lib/winc/winc-server-Linux-x86_64"
test -f "$workdir/squashfs-root/usr/lib/winc/winc-server-Linux-aarch64"
if find "$workdir/squashfs-root/usr/lib" -name 'libwayland*' -print -quit | grep -q .; then
echo "::error::AppImage still bundles Wayland libraries"
exit 1
fi
- name: Verify Debian package
run: |
dpkg-deb --info target/"$TARGET"/release/bundle/deb/*.deb
dpkg-deb --contents target/"$TARGET"/release/bundle/deb/*.deb | tee "$RUNNER_TEMP/deb-contents"
grep -q ./usr/bin/winc-pty "$RUNNER_TEMP/deb-contents"
grep -q ./usr/bin/winc "$RUNNER_TEMP/deb-contents"
grep -q ./usr/lib/winc/winc-server-Linux-x86_64 "$RUNNER_TEMP/deb-contents"
grep -q ./usr/lib/winc/winc-server-Linux-aarch64 "$RUNNER_TEMP/deb-contents"
- name: Stage release assets
run: |
node release/common/collect-assets.mjs --platform "$PLATFORM" \
--bundle "target/$TARGET/release/bundle" --out "$RUNNER_TEMP/release-assets"
- uses: actions/upload-artifact@v7
with:
name: release-assets-linux-${{ inputs.arch }}
path: ${{ runner.temp }}/release-assets
compression-level: 0
if-no-files-found: error
overwrite: true