-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (108 loc) · 3.17 KB
/
ci-rpm-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
# This is a basic workflow to help you get started with Actions
name: Build RPM Packages
# Controls when the workflow will run
on:
workflow_call:
inputs:
ENVIRONMENT:
required: false
type: string
RUNNER:
required: false
default: ubuntu-latest
type: string
PROJECT_NAME:
required: true
type: string
RUN_BACKGROUND:
required: false
type: string
default: 'false'
PACKAGER:
required: false
type: string
default: 'false'
PLATFORM:
required: false
description: Default OS/Arch
default: amd64
type: string
TARGET_ARTIFACT_NAME:
required: false
description: Artifact name.
default: centos
type: string
USE_CMAKE:
required: false
type: boolean
default: false
description: Use CMAKE for building
CMAKE_BUILD_TYPE:
required: false
type: string
default: 'Release'
description: Set СMAKE_BUILD_TYPE variable
CMAKE_INSTALL_PREFIX:
required: false
type: string
default: '/usr'
description: Set CMAKE_INSTALL_PREFIX variable
ADDITIONAL_PACKAGES:
required: false
type: string
default: ''
description: 'Additional packages to install (space delimited)'
UPLOAD_ARTIFACTS:
required: false
type: boolean
default: true
description: 'Enable upload artifacts related steps'
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
SIGNALWIRE_USERNAME:
required: false
SIGNALWIRE_TOKEN:
required: false
jobs:
deploy:
runs-on: ${{ inputs.RUNNER }}
name: Build
environment: ${{ inputs.ENVIRONMENT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build RPM Packages
uses: signalwire/build-rpm-packages-action@main
with:
project_name: ${{ inputs.PROJECT_NAME }}
packager: ${{ inputs.PACKAGER }}
use_cmake: ${{ inputs.USE_CMAKE }}
cmake_build_type: ${{ inputs.CMAKE_BUILD_TYPE }}
cmake_install_prefix: ${{ inputs.CMAKE_INSTALL_PREFIX }}
additional_packages: ${{ inputs.ADDITIONAL_PACKAGES }}
signalwire_username: ${{ secrets.SIGNALWIRE_USERNAME }}
signalwire_token: ${{ secrets.SIGNALWIRE_TOKEN }}
- name: Generate hash file
if: ${{ inputs.UPLOAD_ARTIFACTS }}
run: echo $GITHUB_SHA > hash.txt
env:
GITHUB_SHA: ${{ github.sha }}
- name: Compress files
if: ${{ inputs.UPLOAD_ARTIFACTS }}
run: |
tar -czvf ${{ inputs.TARGET_ARTIFACT_NAME }}.tar.gz $(ls -1 | grep -E '(.rpm|hash.txt)$' | tr -s '\n' ' ')
- name: Generate SHA checksum
if: ${{ inputs.UPLOAD_ARTIFACTS }}
run: |
sha512sum ${{ inputs.TARGET_ARTIFACT_NAME }}.tar.gz > ${{ inputs.TARGET_ARTIFACT_NAME }}.sha1
- uses: actions/upload-artifact@v4
if: ${{ inputs.UPLOAD_ARTIFACTS }}
with:
name: rpm-${{ inputs.PLATFORM }}-artifact
path: |
*.tar.gz
*.sha1