-
Notifications
You must be signed in to change notification settings - Fork 4
178 lines (156 loc) · 6.36 KB
/
ubuntu-packaging.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: ubuntu packaging
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/ubuntu-packaging.yml'
- 'cmake'
release:
types: [ "created" ]
workflow_dispatch:
env:
CONFIGURATION_DIRECTORY: ${{ github.workspace }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ubuntu packaging
runs-on: ubuntu-22.04
container: ghcr.io/centroid-is/centroid-is/framework/tfc-toolchain:latest
strategy:
fail-fast: false
matrix:
build_type: [debug, release]
architecture: [ x86_64, aarch64 ]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '/opt/vcpkg'
vcpkgGitCommitId: '66a252f70eebdd744c02d7ab8c1cc6fe123c70ee'
vcpkgJsonGlob: 'vcpkg.json'
- name: Run CMake consuming CMakePreset.json and vcpkg.json by mean of vcpkg.
uses: lukka/[email protected]
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
workflowPreset: '${{ matrix.architecture }}-gcc-${{matrix.build_type}}'
- name: Upload vcpkg log
if: failure()
uses: actions/upload-artifact@v3
with:
name: vcpkg-build-fail-logs
path: /opt/vcpkg/**/*out.log
- name: Upload vcpkg log
if: failure()
uses: actions/upload-artifact@v3
with:
name: vcpkg-build-fail-logs
path: /opt/vcpkg/**/*err.log
- name: Test install
if: matrix.architecture == 'x86_64'
run: |
apt-get update
apt-get install -y ./build/pack-gcc-${{matrix.build_type}}/*.deb
- id: find-location
name: Find location
shell: bash
run: |
echo "tar-location=$(ls build/*/*.tar.gz)" >> "$GITHUB_OUTPUT"
echo "deb-location=$(ls build/*/*.deb)" >> "$GITHUB_OUTPUT"
echo "rpm-location=$(ls build/*/*.rpm)" >> "$GITHUB_OUTPUT"
- name: Upload debian package
uses: actions/upload-artifact@v3
with:
name: tfc-framework-${{matrix.build_type}}
path: build/pack-*/*.deb
retention-days: 1
- name: Upload Release deb file
if: github.event_name == 'release' && github.event.action == 'created'
id: upload-release-asset-deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.find-location.outputs.deb-location }}
asset_name: tfc-framework-${{matrix.build_type}}-${{matrix.architecture}}.deb
asset_content_type: application/x-tar
- name: Upload rpm package
uses: actions/upload-artifact@v3
with:
name: tfc-framework-${{matrix.build_type}}
path: build/pack-*/*.rpm
retention-days: 1
- name: Upload Release rpm file
if: github.event_name == 'release' && github.event.action == 'created'
id: upload-release-asset-rpm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.find-location.outputs.rpm-location }}
asset_name: tfc-framework-${{matrix.build_type}}-${{matrix.architecture}}.rpm
asset_content_type: application/x-cpio
- name: Upload tar package
uses: actions/upload-artifact@v3
with:
name: tfc-framework-${{matrix.build_type}}
path: build/pack-*/*.tar.gz
retention-days: 1
- name: Upload Release tar file
if: github.event_name == 'release' && github.event.action == 'created'
id: upload-release-asset-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.find-location.outputs.tar-location }}
asset_name: tfc-framework-${{matrix.build_type}}-${{matrix.architecture}}.tar.gz
asset_content_type: application/x-tar
- name: Make debug symbols tar
if: github.event_name == 'release' && github.event.action == 'created' && matrix.build_type == 'release'
run: |
cd build
tar -czf tfc-framework-${{matrix.architecture}}-debug-symbols.tar.gz */*/*.sym
- name: Upload debug symbols
if: github.event_name == 'release' && github.event.action == 'created' && matrix.build_type == 'release'
id: upload-release-symbols-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: build/tfc-framework-${{matrix.architecture}}-debug-symbols.tar.gz
asset_name: tfc-framework-${{matrix.architecture}}-debug-symbols.tar.gz
asset_content_type: application/x-tar
# fix in https://github.com/Skaginn3x/framework/issues/583
# # Upload non debug packages to cloudsmith
# - name: Cloudsmith upload
# if: github.event_name == 'release' && github.event.action == 'created' && matrix.build_type == 'release'
# id: push
# uses: cloudsmith-io/action@master
# with:
# api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
# command: 'push'
# format: 'deb'
# owner: 'skaginn3x' # Your Cloudsmith account name or org name (namespace)
# repo: 'tfc-repo' # Your Cloudsmith Repository name (slug)
# distro: 'otherdeb' # Your Distribution (i.e Debian, Ubuntu)
# release: 'any-version' # Your Distribution Release (i.e xenial, buster)
# republish: 'true' # needed ONLY if version is not changing
# file: 'build/*/*.deb' # debian package filename