-
-
Notifications
You must be signed in to change notification settings - Fork 41
84 lines (69 loc) · 2.13 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
name: Build packages
on:
push:
branches: ['master']
pull_request:
jobs:
build-packages:
strategy:
matrix:
target-os: [debian-12, ubuntu-2204, fedora-37, fedora-38, arch]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install pkger
run: |
curl -L -o /tmp/pkger.deb https://github.com/vv9k/pkger/releases/download/0.11.0/pkger-0.11.0-0.amd64.deb
sudo apt -y install /tmp/pkger.deb
- name: Build packages
run: pkger -c .pkger.yml build lact -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: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target-os }}
path: release-artifacts/*
create-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/[email protected]
with:
removeArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: true
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