-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (98 loc) · 2.87 KB
/
release-linux.yaml
File metadata and controls
114 lines (98 loc) · 2.87 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:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g. 1.2.3)'
required: true
permissions:
contents: write
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve_version.outputs.version }}
steps:
- name: Resolve version
id: resolve_version
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
version="${{ inputs.version }}"
else
version="${GITHUB_REF_NAME#v}"
fi
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$ ]]; then
echo "Invalid version: $version" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
package:
runs-on: ubuntu-latest
needs: prepare
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y ruby ruby-dev build-essential rpm dpkg-dev
sudo gem install --no-document fpm
- name: Build release packages
env:
VERSION: ${{ needs.prepare.outputs.version }}
OUT_DIR: ${{ github.workspace }}/dist
run: |
chmod +x Packaging.Linux/*.sh
./Packaging.Linux/build-release-packages.sh "${{ matrix.arch }}"
- name: Upload package artifacts (${{ matrix.arch }})
uses: actions/upload-artifact@v4
with:
name: linux-packages-${{ matrix.arch }}
path: dist/*
aur-source:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v4
- name: Build AUR source archive
env:
VERSION: ${{ needs.prepare.outputs.version }}
OUT_DIR: ${{ github.workspace }}/dist
run: |
chmod +x Packaging.Linux/*.sh
./Packaging.Linux/build-aur-source.sh
- name: Upload AUR source artifact
uses: actions/upload-artifact@v4
with:
name: linux-packages-aur
path: dist/*
release:
runs-on: ubuntu-latest
needs: [prepare, package, aur-source]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: linux-packages-*
path: release-assets
merge-multiple: true
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
name: v${{ needs.prepare.outputs.version }}
generate_release_notes: true
files: |
release-assets/*