-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (68 loc) · 2.12 KB
/
package.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
# SPDX-FileCopyrightText: 2024 Roman Gilg <[email protected]>
# SPDX-License-Identifier: MIT
name: Package
on:
workflow_call:
inputs:
image:
description: Image to package on
required: true
type: string
artifact-name:
description: Artifact name of build dir
required: false
type: string
default: 'build'
package-name:
description: Name of the resulting packages
required: true
type: string
jobs:
deb:
name: Create deb
runs-on: ubuntu-latest
container:
image: ${{ inputs.image }}
steps:
- name: Install dpkg
run: pacman -Sy --needed --quiet --noconfirm dpkg
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
- name: Untar artifact
run: tar -xzf build-dir.tar
- name: Run CPack
run: cd build && cpack -G DEB -D CPACK_DEBIAN_FILE_NAME=${{ inputs.package-name }}.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: deb-package
path: build/_CPack_Packages/Linux/DEB/${{ inputs.package-name }}.deb
retention-days: 8
tar:
name: Create tar
runs-on: ubuntu-latest
container:
image: ${{ inputs.image }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
- name: Untar artifact
run: tar -xzf build-dir.tar
- name: Run CPack
# Need to use CPACK_PACKAGE_FILE_NAME instead of CPACK_ARCHIVE_FILE_NAME
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/20419
run: cd build && cpack -G TGZ -D CPACK_PACKAGE_FILE_NAME=${{ inputs.package-name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tar-package
path: build/_CPack_Packages/Linux/TGZ/${{ inputs.package-name }}.tar.gz
retention-days: 8