FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
netdata/.github/workflows/packaging.yml at master · feiyunwill/netdata · GitHub
feiyunwill
/
netdata
Public
forked from
netdata/netdata
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
netdata
/
.github
/
workflows
/
packaging.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
149 lines (149 loc) · 7.76 KB
Breadcrumbs
netdata
/
.github
/
workflows
/
packaging.yml
Copy path
File metadata and controls
149 lines (149 loc) · 7.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
---
#
Handles building of binary packages for the agent.
name
:
Packages
on
:
pull_request
:
branches
:
-
master
-
develop
workflow_dispatch
:
inputs
:
type
:
name
:
Package build type
default
:
devel
required
:
true
version
:
name
:
Package version
required
:
false
env
:
DO_NOT_TRACK
:
1
jobs
:
build
:
name
:
Build
runs-on
:
ubuntu-latest
env
:
DOCKER_CLI_EXPERIMENTAL
:
enabled
strategy
:
matrix
:
include
:
-
{distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
-
{distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/i386, arch: i386}
-
{distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
-
{distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/i386, arch: i386}
-
{distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64, alias: bullseye}
-
{distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/i386, arch: i386, alias: bullseye}
-
{distro: ubuntu, version: "16.04", pkgclouddistro: ubuntu/xenial, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
-
{distro: ubuntu, version: "16.04", pkgclouddistro: ubuntu/xenial, format: deb, base_image: ubuntu, platform: linux/i386, arch: i386}
-
{distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
-
{distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/i386, arch: i386}
-
{distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
-
{distro: ubuntu, version: "21.04", pkgclouddistro: ubuntu/hirsute, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
-
{distro: centos, version: "7", pkgclouddistro: el/7, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
-
{distro: centos, version: "8", pkgclouddistro: el/8, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64}
-
{distro: fedora, version: "33", pkgclouddistro: fedora/33, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
-
{distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
-
{distro: opensuse, version: "15.2", pkgclouddistro: opensuse/15.2, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
-
{distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
#
We intentiaonally disable the fail-fast behavior so that a
#
build failure for one version doesn't prevent us from publishing
#
successfully built and tested packages for another version.
fail-fast
:
false
max-parallel
:
8
steps
:
-
name
:
Checkout PR
#
Checkout the PR if it's a PR.
if
:
github.event_name == 'pull_request'
uses
:
actions/checkout@v2
with
:
fetch-depth
:
0
#
We need full history for versioning
submodules
:
recursive
-
name
:
Checkout Tag
#
Otherwise check out the tag that triggered this.
if
:
github.event_name == 'workflow_dispatch'
uses
:
actions/checkout@v2
with
:
ref
:
${{ github.event.ref }}
fetch-depth
:
0
#
We need full history for versioning
submodules
:
recursive
-
name
:
Check Base Branch
run
:
|
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "runtype=${{ github.event.inputs.type }}" >> $GITHUB_ENV
case "${{ github.event.inputs.type }}" in
"release")
echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}" >> $GITHUB_ENV
echo "pkg_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "pkg_retention_days=365" >> $GITHUB_ENV
;;
"nightly")
echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}-edge" >> $GITHUB_ENV
echo "pkg_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "pkg_retention_days=30" >> $GITHUB_ENV
;;
*)
echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}-devel" >> $GITHUB_ENV
echo "pkg_version=0.${GITHUB_SHA}" >> $GITHUB_ENV
echo "pkg_retention_days=30" >> $GITHUB_ENV
;;
esac
else
echo "runtype=test" >> $GITHUB_ENV
echo "pkg_version=$(cut -d'-' -f 1 packaging/version | sed -e 's/^v//')" >> $GITHUB_ENV
fi
-
name
:
Setup QEMU
if
:
matrix.platform != 'linux/amd64'
uses
:
docker/setup-qemu-action@v1
-
name
:
Prepare Docker Environment
shell
:
bash
run
:
|
echo '{"cgroup-parent": "/actions_job", "experimental": true}' | sudo tee /etc/docker/daemon.json 2>/dev/null
sudo service docker restart
-
name
:
Set Base Image Version
shell
:
bash
run
:
|
if [ -z "${{ matrix.alias }}" ] ; then
echo "version=${{ matrix.version }}" >> $GITHUB_ENV
else
echo "version=${{ matrix.alias }}" >> $GITHUB_ENV
fi
-
name
:
Build Packages
shell
:
bash
run
:
|
docker run -e DO_NOT_TRACK=1 -e VERSION=${{ env.pkg_version }} --platform=${{ matrix.platform }} -v $PWD:/netdata netdata/package-builders:${{ matrix.distro }}${{ matrix.version }}
-
name
:
Test Packages
shell
:
bash
run
:
|
docker run -e DO_NOT_TRACK=1 -e DISTRO=${{ matrix.distro }} -e VERSION=${{ env.pkg_version }} -e DISTRO_VERSION=${{ env.version }} --platform=${{ matrix.platform }} -v $PWD:/netdata ${{ matrix.base_image }}:${{ env.version }} /netdata/.github/scripts/pkg-test.sh
-
name
:
Upload
if
:
github.event_name == 'workflow_dispatch'
shell
:
bash
env
:
PKG_CLOUD_TOKEN
:
${{ secrets.PACKAGE_CLOUD_API_KEY }}
run
:
|
echo "Packages to upload:\n$(ls artifacts/*.${{ matrix.format }})"
for pkgfile in artifacts/*.${{ matrix.format }} ; do
.github/scripts/package_cloud_wrapper.sh yank ${{ env.repo }}/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) ||
true
.github/scripts/package_cloud_wrapper.sh push ${{ env.repo }}/${{ matrix.pkgclouddistro }} ${pkgfile}
done
-
name
:
Clean
if
:
github.event_name == 'workflow_dispatch'
shell
:
bash
env
:
REPO
:
${{ env.repo }}
PKG_CLOUD_TOKEN
:
${{ secrets.PACKAGE_CLOUD_API_KEY }}
PACKAGE_CLOUD_RETENTION_DAYS
:
${{ env.pkg_retention_days }}
run
:
.github/scripts/old_package_purging.sh
-
name
:
Failure Notification
uses
:
rtCamp/action-slack-notify@v2
env
:
SLACK_COLOR
:
'
danger
'
SLACK_FOOTER
:
SLACK_ICON_EMOJI
:
'
:github-actions:
'
SLACK_TITLE
:
'
Package Build failed:
'
SLACK_USERNAME
:
'
GitHub Actions
'
SLACK_MESSAGE
:
"
${{ matrix.pkgclouddistro }} ${{ matrix.version }} package build for ${{ matrix.arch }} failed.
"
SLACK_WEBHOOK
:
${{ secrets.SLACK_WEBHOOK_URL }}
if
:
>-
${{
failure()
&& github.event_name != 'pull_request'
&& startsWith(github.ref, 'refs/heads/master')
}}
Back
|
FazBrowse Home
|
New Git URL