-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (89 loc) · 2.59 KB
/
ci-deb-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
name: Build Deb Packages
# Controls when the workflow will run
on:
workflow_call:
inputs:
ENVIRONMENT:
required: false
type: string
RUNNER:
required: false
default: self-hosted
type: string
PROJECT_NAME:
required: true
type: string
RUN_BACKGROUND:
required: false
type: string
default: 'false'
PACKAGER:
required: false
type: string
default: 'false'
AUTHOR_EMAIL:
required: true
type: string
description: Author email used to send files to GitHub.
TARGET_BRANCH:
required: true
type: string
description: Target branch to make a PR.
OS_FAMILIES:
required: true
type: string
description: Comma-separated list to inlcude all Debian families.
secrets:
DOCKERHUB_USERNAME:
required: false
DOCKERHUB_TOKEN:
required: false
PAT:
required: false
jobs:
deploy:
runs-on: ${{ inputs.RUNNER }}
name: Build
permissions: write-all
environment: ${{ inputs.ENVIRONMENT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout actions
uses: actions/checkout@v4
with:
repository: signalwire/actions-template
ref: main
path: actions
- name: Build Deb Packages
uses: signalwire/build-deb-${{matrix.os_name}}-packages-action@main
- name: Set default time
run: |
echo current_time=$(date "+%Y.%m.%d-%H.%M.%S") >> $GITHUB_ENV
echo current_time=$(date "+%Y.%m.%d-%H.%M.%S") >> $GITHUB_OUTPUT
- name: Create dummy file to ilustrate that the copy has finished
run: echo $GITHUB_SHA > ready.txt
if: inputs.TRANSFER_CONFIRMATION == true
env:
GITHUB_SHA: ${{ github.sha }}
- name: Compress files
run: |
tar -czvf $current_time-${{matrix.os_name}}.tar.gz $(ls | grep '.rpm\|ready.txt')
- name: Generate SHA checksum
run: |
sha512sum $current_time-${{matrix.os_name}}.tar.gz > $current_time-${{matrix.os_name}}.sha1
- uses: actions/upload-artifact@v4
with:
name: deb-${{matrix.os_name}}-artifact
path: |
*.tar.gz
*.sha1
- uses: ./actions/.github/actions/git_add_pr
name: Sync changelog
with:
AUTHOR_EMAIL: ${{ inputs.AUTHOR_EMAIL }}
MESSAGE: Sync changelog ${{ github.sha }}
FILES: ./debian/changelog
SOURCE_BRANCH: feat/${{ github.sha }}
TARGET_BRANCH: ${{ inputs.TARGET_BRANCH }}