-
Notifications
You must be signed in to change notification settings - Fork 208
156 lines (132 loc) · 4.3 KB
/
create-packages.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
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
151
152
153
154
155
156
name: Create Packages
on:
release:
types: [published]
jobs:
CPack-Package-Build:
strategy:
fail-fast: false
matrix:
include:
- release: ubuntu-2004
extension: ".deb"
OS-name: "ubuntu/focal"
- release: oraclelinux-8
extension: ".rpm"
OS-name: "el/8"
- release: fedora-34
extension: ".rpm"
OS-name: "fedora/34"
# build issue on fedora 35
# - release: fedora-35
# extension: ".rpm"
# OS-name: "fedora/35"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build Container
run: docker build . -f ./.github/images/${{ matrix.release }}/Dockerfile -t package_builder
- name: Packaging
run: docker run -e DOMAIN_SIZE="64bit" --name container -t package_builder
- name: Extract
id: extract_pkg
run: |-
docker cp container:/souffle/build/ . &&
cd build &&
echo "pkg_name=$(ls *${{ matrix.extension }} | head -n1)" >> $GITHUB_OUTPUT
echo "artifact_name=x86_64-${{ matrix.release }}-$(ls *${{ matrix.extension }} | head -n1)" >> $GITHUB_OUTPUT
- name: Naming Artifact
run: cp build/${{ steps.extract_pkg.outputs.pkg_name }} build/${{ steps.extract_pkg.outputs.artifact_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.extract_pkg.outputs.artifact_name }}
path: build/${{ steps.extract_pkg.outputs.artifact_name }}
Arch-Package-Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare
id: prepare
run: |-
echo "release_tag=$(git describe --tags --always | sed "s/-.*$//")" >> $GITHUB_OUTPUT
- name: Build Container
run: docker build ./.github/images/arch-linux/ -t package_builder
- name: Packaging
run: >
docker run
-e RELEASE_TAG=${{ steps.prepare.outputs.release_tag }}
-e REPO_OWNER=${{ github.repository_owner }}
--name container
-t package_builder
- name: Setup Credentials
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.AUR_PRIVATE_KEY }}
name: aur
known_hosts: ${{ secrets.AUR_KNOWN_HOSTS }}
config: |
Host aur.archlinux.org
IdentityFile ~/.ssh/aur
User aur
- name: Upload
run: |-
git clone ssh://[email protected]/souffle.git &&
cd souffle &&
docker cp container:/home/builduser/PKGBUILD . &&
docker cp container:/home/builduser/.SRCINFO . &&
git config user.email "[email protected]" &&
git config user.name "Xiaowen Hu" &&
git add PKGBUILD .SRCINFO &&
git commit -m "release version ${{ steps.prepare.outputs.release_tag }}" &&
git push
Upload-Release-Assests:
needs: CPack-Package-Build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: ./downloads
- name: Create Checksum
run: |-
mkdir result &&
mv downloads/*/* result/ &&
cd result &&
sha512sum * > sha512sum.txt
- name: Upload Release Assests
uses: softprops/action-gh-release@v1
with:
files: |
result/*
Upload-Repo-Files:
needs: CPack-Package-Build
if: ${{ always() }}
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
clean: false
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: ./downloads
- name: Configure GPG Key
run: |-
.github/scripts/config_gpg.sh
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Upload Repo Files
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run : |-
.github/scripts/updatePPA.sh