-
Notifications
You must be signed in to change notification settings - Fork 358
150 lines (136 loc) · 4.21 KB
/
Copy pathlaunchpad-ppa.yml
File metadata and controls
150 lines (136 loc) · 4.21 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Launchpad PPA
permissions:
contents: read
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
prepare-matrix:
name: Prepare matrix
runs-on: ubuntu-latest
outputs:
package_matrix: ${{ steps.set-matrix.outputs.package_matrix }}
steps:
- name: Define shared matrix values
id: set-matrix
run: |
{
echo 'package_matrix<<EOF'
cat <<'JSON'
{
"include": [
{
"release": "24.04",
"distro": "ubuntu",
"codename": "noble"
},
{
"release": "25.10",
"distro": "ubuntu",
"codename": "questing"
},
{
"release": "26.04",
"distro": "ubuntu",
"codename": "resolute"
}
]
}
JSON
echo 'EOF'
} >> "$GITHUB_OUTPUT"
package:
name: Build
needs: prepare-matrix
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix: ${{ fromJSON(needs.prepare-matrix.outputs.package_matrix) }}
container:
image: ghcr.io/lemonade-sdk/lemonade/build-environment:${{ matrix.distro }}${{ matrix.release }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Configure git safe directory
run: git config --global --add safe.directory $(pwd)
- name: Prepare Debian build
id: get_version
uses: ./.github/actions/prepare-debian-build
with:
release: ${{ matrix.release }}
codename: ${{ matrix.codename }}
- name: Get short SHA
id: short_sha
run: echo "sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Catch missing build-deps
run: |
apt-get update && apt-get build-dep . -y
- name: Build binary package
id: build_binary
if: github.event_name == 'pull_request'
uses: ./.github/actions/build-debian-package
with:
package-type: binary
deb-version: ${{ steps.get_version.outputs.version }}
- name: Build source package
id: build_source
if: github.event_name != 'pull_request'
uses: ./.github/actions/build-debian-package
with:
package-type: source
deb-version: ${{ steps.get_version.outputs.version }}
- name: Upload Debian package
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: lemonade-${{ matrix.codename }}-deb
path: ${{ steps.build_binary.outputs.output-dir }}/*.deb
retention-days: 30
- name: Upload source package
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v7
with:
name: lemonade-${{ matrix.codename }}-source-package
path: ${{ steps.build_source.outputs.output-dir }}/*
retention-days: 30
upload-stable:
name: Upload (Stable)
strategy:
matrix: ${{ fromJSON(needs.prepare-matrix.outputs.package_matrix) }}
needs: [prepare-matrix, package]
permissions:
contents: read
if: ${{ startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}
uses: ./.github/workflows/upload.yml
with:
target: ppa:lemonade-team/stable
artifact: lemonade-${{ matrix.codename }}-source-package
secrets: inherit
upload-bleeding-edge:
name: Upload (Bleeding Edge)
strategy:
matrix: ${{ fromJSON(needs.prepare-matrix.outputs.package_matrix) }}
needs: [prepare-matrix, package]
permissions:
contents: read
if: ${{ !startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}
uses: ./.github/workflows/upload.yml
with:
target: ppa:lemonade-team/bleeding-edge
artifact: lemonade-${{ matrix.codename }}-source-package
secrets: inherit