-
Notifications
You must be signed in to change notification settings - Fork 69
243 lines (242 loc) · 11.3 KB
/
dev-builds.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Vagrant Development Builds
on:
repository_dispatch:
types:
- nightlies
- build
push:
branches:
- 'nightlies'
workflow_dispatch:
jobs:
vagrant-artifacts:
if: github.repository == 'hashicorp/vagrant-builders'
name: Build Core Vagrant Artifacts
permissions:
contents: write
uses: ./.github/workflows/vagrant-artifacts.yml
with:
vagrant-commit-id: ${{ github.event.client_payload.commit_id }}
info:
name: Generate Build Information
if: github.repository == 'hashicorp/vagrant-builders'
needs: [vagrant-artifacts]
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
contents: write
id-token: write
outputs:
release-name: ${{ steps.generate.outputs.release-name }}
release-exists: ${{ steps.generate.outputs.release-exists }}
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/teams/vagrant/hashibot vagrant_token;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Generate Development Build Information
id: generate
run: ./.ci/dev-build-information "${VAGRANT_VERSION}" "${VAGRANT_SHORT_ID}" "${RUN_NUMBER}"
env:
HASHIBOT_TOKEN: ${{ steps.secrets.outputs.vagrant_token }}
RUN_NUMBER: ${{ github.run_number }}
VAGRANT_VERSION: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
VAGRANT_SHORT_ID: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
build-appimage-package:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build appimage package
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-appimage.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-licenses-name: ${{ needs.vagrant-artifacts.outputs.licenses-name }}
vagrant-licenses-path: ${{ needs.vagrant-artifacts.outputs.licenses-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-archlinux-package:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build Arch Linux Package
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-arch.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-deb-packages:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build deb packages
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-debs.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-macos-package:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build macOS package
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-macos.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-licenses-name: ${{ needs.vagrant-artifacts.outputs.licenses-name }}
vagrant-licenses-path: ${{ needs.vagrant-artifacts.outputs.licenses-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-rpm-packages:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build rpm packages
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-rpms.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-windows-packages:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Build Windows Packages
needs: [info, vagrant-artifacts]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-windows.yml
with:
vagrant-artifacts-name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
vagrant-artifacts-path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
vagrant-gem-name: ${{ needs.vagrant-artifacts.outputs.gem-name }}
vagrant-gem-path: ${{ needs.vagrant-artifacts.outputs.gem-path }}
vagrant-licenses-name: ${{ needs.vagrant-artifacts.outputs.licenses-name }}
vagrant-licenses-path: ${{ needs.vagrant-artifacts.outputs.licenses-path }}
vagrant-version: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
vagrant-shasum: ${{ needs.vagrant-artifacts.outputs.vagrant-short-commit-id }}
secrets: inherit
build-release:
if: github.repository == 'hashicorp/vagrant-builders' && needs.info.outputs.release-exists != 'true'
name: Vagrant GitHub Release
needs: [vagrant-artifacts, info, build-appimage-package, build-archlinux-package, build-deb-packages, build-macos-package, build-rpm-packages, build-windows-packages]
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
id-token: write
contents: write
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/teams/vagrant/hashibot vagrant_token;
kv/data/teams/vagrant/hashibot signore_token;
kv/data/github/hashicorp/vagrant-builders signore_client_id;
kv/data/github/hashicorp/vagrant-builders signore_client_secret;
kv/data/github/hashicorp/vagrant-builders signore_gpg_signer;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Fetch appimage package
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-appimage-package.outputs.appimage-package-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Arch Linux package
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-archlinux-package.outputs.arch-package-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch deb packages
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-deb-packages.outputs.deb-packages-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch macOS DMG
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-macos-package.outputs.dmg-cache-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch rpm packages
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-rpm-packages.outputs.rpm-packages-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch 32 Bit Windows Package
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-windows-packages.outputs.msi-32-signed-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch 64 Bit Windows Package
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-windows-packages.outputs.msi-64-signed-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Vagrant Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: ${{ needs.vagrant-artifacts.outputs.artifacts-name }}
path: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
- name: Add Build Artifacts
run: cp "${VAGRANT_ARTIFACTS}/"* ./pkg
env:
VAGRANT_ARTIFACTS: ${{ needs.vagrant-artifacts.outputs.artifacts-path }}
- name: Generate shasums
run: ./.ci/dev-builds-shasums ./pkg "${VAGRANT_VERSION}"
env:
SIGNORE_CLIENT_ID: ${{ steps.secrets.outputs.signore_client_id }}
SIGNORE_CLIENT_SECRET: ${{ steps.secrets.outputs.signore_client_SECRET }}
SIGNORE_SIGNER: ${{ steps.secrets.outputs.signore_gpg_signer }}
HASHIBOT_TOKEN: ${{ steps.secrets.outputs.signore_token }}
VAGRANT_VERSION: ${{ needs.vagrant-artifacts.outputs.vagrant-version }}
- name: Publish Dev Build
run: ./.ci/publish-dev-builds "${RELEASE_NAME}" "${COMMIT_ID:-main}" "${BRANCH:-main}" "${RELEASE_TYPE}" ./pkg
env:
COMMIT_ID: ${{ needs.vagrant-artifacts.outputs.vagrant-commit-id }}
BRANCH: ${{ github.event.client_payload.branch }}
RELEASE_NAME: ${{ needs.info.outputs.release-name }}
RELEASE_TYPE: ${{ github.event.action }}
HASHIBOT_TOKEN: ${{ steps.secrets.outputs.vagrant_token }}