-
Notifications
You must be signed in to change notification settings - Fork 4
147 lines (129 loc) · 5.19 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
name: ubuntu packaging
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ "created" ]
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/skaginn3x/skaginn3x/framework/tfc-toolchain:sha-6cd5f4c
strategy:
fail-fast: false
matrix:
build_type: [debug, release]
architecture: [ x86_64, aarch64 ]
steps:
- uses: actions/checkout@v3
- 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: 'b6e73bd3dc8a8d061ee601336b8f43d2570a7080'
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: 'packflow-${{ 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
- 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
- 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
- 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
# 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