Repository navigation
134 lines (107 loc) · 4.23 KB
/
Copy pathpackage-linux.yml
File metadata and controls
134 lines (107 loc) · 4.23 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright (c) Files Community
# Licensed under the MIT License.
# Abstract:
# Publishes a self-contained linux-x64 build of Files and packages it as a tarball, AppImage, Flatpak
# bundle and AUR (linuxfiles-bin) recipe. Triggered manually or by pushing a linux-v* tag, which also
# creates a GitHub release with the artifacts. Uses no secrets beyond the workflow token.
name: Package Linux
on:
workflow_dispatch:
push:
tags:
- 'linux-v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
package-linux-x64:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Fetch verified Uno Wayland packages
run: build/fetch-uno-wayland.sh
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', 'Directory.Build.props', 'nuget.wayland.config', 'build/uno-wayland-packages.sha256') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Remove cached Uno fork packages before restore
run: build/clear-uno-wayland-cache.sh
- name: Publish self-contained linux-x64
run: scripts/linux/publish.sh --rid linux-x64 --tarball
- name: Bundle packaging files
run: |
cp LICENSE-MIT packaging/LICENSE-MIT
tar -C packaging -czf artifacts/files-packaging.tar.gz linux LICENSE-MIT
- name: Build AppImage
run: packaging/linux/appimage/build-appimage.sh
- name: Install Flatpak tooling
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y --noninteractive flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08
- name: Build Flatpak bundle
run: scripts/linux/build-flatpak.sh --bundle
- name: Render AUR recipe
if: startsWith(github.ref, 'refs/tags/linux-v')
run: scripts/linux/gen-aur.sh "${GITHUB_REF_NAME#linux-v}" artifacts artifacts/aur
- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: files-linux-x64
path: |
artifacts/files-linux-x64.tar.gz
artifacts/files-packaging.tar.gz
artifacts/Files-x86_64.AppImage
artifacts/Files-x86_64.flatpak
artifacts/aur/PKGBUILD
artifacts/aur/.SRCINFO
include-hidden-files: true
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/linux-v')
needs: package-linux-x64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: files-linux-x64
path: dist
- name: Checksums and AUR recipe assets
run: |
cd dist
sha256sum files-linux-x64.tar.gz files-packaging.tar.gz Files-x86_64.AppImage Files-x86_64.flatpak > SHA256SUMS
# Release asset names may not start with a dot, so .SRCINFO is attached as SRCINFO.
cp aur/PKGBUILD PKGBUILD
cp aur/.SRCINFO SRCINFO
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
cd dist
assets=(files-linux-x64.tar.gz files-packaging.tar.gz Files-x86_64.AppImage Files-x86_64.flatpak SHA256SUMS PKGBUILD SRCINFO)
# A direct lookup also finds drafts for a token with write access.
if gh release view "$TAG" >/dev/null 2>&1; then
# Draft or already published: keep its notes and state, replace the assets with the fresh build.
gh release upload "$TAG" "${assets[@]}" --clobber
else
flags=()
# linux-v0.1.0-alpha1 is a prerelease; linux-v0.1.0 is stable.
[[ "${TAG#linux-v}" == *-* ]] && flags+=(--prerelease)
gh release create "$TAG" "${assets[@]}" --title "$TAG" --generate-notes "${flags[@]}"
fi