forked from apache/trafficserver
-
Notifications
You must be signed in to change notification settings - Fork 11
148 lines (148 loc) · 4.86 KB
/
nightly.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
148
---
name: Nightly Build
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
env:
DEBFULLNAME: "github-actions[bot]"
DEBEMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
DEBIAN_FRONTEND: noninteractive
DPKG_COLORS: always
TZ: UTC
jobs:
calendar:
name: Date and Time
runs-on: ubuntu-20.04
outputs:
date: ${{ steps.datetime.outputs.date }}
steps:
- name: Get Current Date
id: datetime
run: echo "date=$(date +%s)" >> $GITHUB_OUTPUT
build:
name: Build TrafficServer
needs: calendar
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
profile: [debug, release, relwithdebinfo]
steps:
- name: Update Apt Package Index
run: |
echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections
sudo apt-mark hold grub-efi-amd64-signed
sudo apt-get update --quiet
sudo apt-get --yes --quiet upgrade
- name: Setup Build Environment
run: >-
sudo apt-get install --yes
git-buildpackage
build-essential
devscripts
debhelper
equivs
libbrotli-dev
- name: Setup Maintenance Script Path
run: echo "${{github.workspace}}/readme-and-settings/debian/scripts" >> $GITHUB_PATH
- name: Setup GitHub Actions Bot
run: |-
git config --global user.name "$DEBFULLNAME"
git config --global user.email "$DEBEMAIL"
- name: Checkout Netlify TrafficServer 9.1.x
uses: actions/checkout@v2
with:
ref: 9.1.x-netlify
path: 9.1.x-netlify
- name: Checkout Netlify TrafficServer 9.2.x
uses: actions/checkout@v2
with:
ref: 9.2.x-netlify
path: 9.2.x-netlify
- name: Checkout Debian Package Files
uses: actions/checkout@v2
with:
ref: readme-and-settings
path: readme-and-settings
- name: Copy Debian Packaging Files
run: |-
cp -r readme-and-settings/debian 9.1.x-netlify/
cp -r readme-and-settings/debian 9.2.x-netlify/
- name: Update 9.1.x Changelog
working-directory: 9.1.x-netlify
run: >-
update-debian-changelog
--distribution=nightly
--version=${{needs.calendar.outputs.date}}
--revision=0
--profile=${{matrix.profile}}
--package=netlify-trafficserver-dev
--package=netlify-trafficserver
- name: Update 9.2.x Changelog
working-directory: 9.2.x-netlify
run: >-
update-debian-changelog
--distribution=nightly
--version=${{needs.calendar.outputs.date}}
--revision=0
--profile=${{matrix.profile}}
--package=netlify-trafficserver-dev
--package=netlify-trafficserver
- name: Build 9.1.x Packages
working-directory: 9.1.x-netlify
run: >-
gbp buildpackage
--git-verbose
--git-debian-branch=readme-and-settings
--git-upstream-tag=9.1.x-netlify
--build-profiles=${{matrix.profile}}
--buildinfo-option=-u${GITHUB_WORKSPACE}
--changes-option=-u${GITHUB_WORKSPACE}
- name: Build 9.2.x Packages
working-directory: 9.2.x-netlify
run: >-
gbp buildpackage
--git-verbose
--git-debian-branch=readme-and-settings
--git-upstream-tag=9.2.x-netlify
--build-profiles=${{matrix.profile}}
--buildinfo-option=-u${GITHUB_WORKSPACE}
--changes-option=-u${GITHUB_WORKSPACE}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{matrix.profile}}
path: |-
${{github.workspace}}/*.deb
${{github.workspace}}/*.ddeb
upload:
name: Create Release
needs: [build, calendar]
runs-on: ubuntu-20.04
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Create Release
uses: actions/create-release@v1
id: release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_name: ${{ needs.calendar.outputs.date}}
tag_name: ${{ needs.calendar.outputs.date}}
- name: Upload Packages
run: >-
shopt -s globstar;
set -e;
upload_url=$(echo "${{steps.release.outputs.upload_url}}" | sed -e 's/{.*}//g')?name;
for filename in $(ls **/*.{deb,ddeb});
do curl
-X POST
-H "Authorization: token ${{github.token}}"
-H "Accept: application/vnd.github.v3+json"
-H "Content-Length: $(stat --printf='%s' ${filename})"
-H "Content-Type: application/vnd.debian.binary-package"
--data-binary @${filename}
${upload_url}=$(basename ${filename});
done