-
-
Notifications
You must be signed in to change notification settings - Fork 39
141 lines (119 loc) · 4.06 KB
/
build-packages.yaml
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
name: Build packages
on:
push:
branches: ['master']
tags: '*'
pull_request:
jobs:
build-packages:
strategy:
matrix:
target-os: [ debian-12, ubuntu-2204, ubuntu-2404, fedora-39, fedora-40, fedora-41, arch, opensuse-tumbleweed ]
recipe: [ lact, lact-headless ]
include:
- target-os: fedora-39
recipe: lact-libadwaita
- target-os: fedora-40
recipe: lact-libadwaita
- target-os: fedora-41
recipe: lact-libadwaita
- target-os: arch
recipe: lact-libadwaita
- target-os: opensuse-tumbleweed
recipe: lact-libadwaita
- target-os: rhel-8
recipe: lact-headless
- target-os: rhel-9
recipe: lact-headless
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Import gpg key
run: |
echo -n "$GPG_KEY" | base64 -d > /tmp/package-signing-key.gpg
echo -n "$GPG_KEY" | base64 -d | gpg --import || true
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: Install pkger
run: |
curl -L -o /usr/local/bin/pkger https://github.com/ilya-zlobintsev/pkger/releases/download/v0.11.1/pkger
chmod +x /usr/local/bin/pkger
- name: Build packages (with signing)
if: ${{ contains(matrix.target-os, 'fedora') && env.GPG_KEY_PASSWORD != '' }}
run: pkger -t -c .pkger.yml build ${{ matrix.recipe }} -i ${{ matrix.target-os }}
env:
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Build packages (without signing)
if: ${{ !contains(matrix.target-os, 'fedora') }}
run: pkger -t -c .pkger.yml build --no-sign ${{ matrix.recipe }} -i ${{ matrix.target-os }}
- name: Copy release files
run: |
OUT_DIR=$PWD/release-artifacts
mkdir -p $OUT_DIR
pushd pkg/output
for DISTRO in $(ls); do
cd $DISTRO
rm -f *.src.rpm
for FILE in $(ls); do
NAME="${FILE%.*}"
EXT="${FILE##*.}"
OUT_NAME="$OUT_DIR/$NAME.$DISTRO.$EXT"
cp $FILE $OUT_NAME
done
cd ..
done
popd
- name: Save gpg key
run: |
gpg --armor --export > $PWD/release-artifacts/lact.pubkey
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target-os }}
path: release-artifacts/*
create-test-release:
needs: build-packages
runs-on: ubuntu-latest
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: downloaded-artifacts/
- name: Create release
uses: ncipollo/release-action@v1.12.0
with:
removeArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: "downloaded-artifacts/*/*"
body: ${{ github.event.head_commit.message }}
prerelease: true
name: Test release
tag: test-build
- name: Update test-build tag
run: |
git tag -f test-build
git push -f origin test-build
shell: bash
create-stable-release:
needs: build-packages
runs-on: ubuntu-latest
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: downloaded-artifacts/
- name: Create release
uses: ncipollo/release-action@v1.12.0
with:
artifacts: "downloaded-artifacts/*/*"
name: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
body: ${{ github.ref_name }} changelog goes here