-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (48 loc) · 1.76 KB
/
artifacts.yml
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
name: artifacts
on: [push, pull_request]
## Tests that all artifacts can be built on every push.
## Uploads the artifacts to the GitHub release page for tags.
jobs:
rpm:
runs-on: ubuntu-20.04
container: registry.suse.com/bci/bci-base:15.5
steps:
- name: setup-environment
run: |
zypper install -y libmount-devel gcc make rpm-build git sudo python3 wget
- name: clone
uses: actions/checkout@v2
- name: build
run: |
set -x
# x86
./rpm/generate-rpm.sh -s . -b rpm-build -a x86_64
rpmbuild -bs --define "_topdir rpm-build" --target=x86_64 rpm-build/SPECS/uenv.spec
sudo rpmbuild --target=x86_64 --rebuild "$(find rpm-build/SRPMS -name '*.rpm' -type f -print -quit)" --define "_topdir $(pwd)/rpm-build"
find rpm-build -name '*.rpm' -type f -exec cp {} . \;
# aarch64
sudo rm -rf ./rpm-build
./rpm/generate-rpm.sh -s . -b rpm-build -a aarch64
rpmbuild -bs --define "_topdir rpm-build" --target=aarch64 rpm-build/SPECS/uenv.spec
sudo rpmbuild --target=aarch64 --rebuild "$(find rpm-build/SRPMS -name '*.rpm' -type f -print -quit)" --define "_topdir $(pwd)/rpm-build"
find rpm-build -name '*.rpm' -type f -exec cp {} . \;
- name: upload-rpm
uses: actions/upload-artifact@v3
with:
name: rpm
path: '*.rpm'
tag-release:
runs-on: ubuntu-20.04
needs: rpm
permissions:
contents: write
steps:
- name: download-artifacts
uses: actions/download-artifact@v3
with:
name: rpm
- name: release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: '*.rpm'