-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpublish.yaml
150 lines (142 loc) · 5.33 KB
/
publish.yaml
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
# Copyright 2024 Defense Unicorns
# SPDX-License-Identifier: AGPL-3.0-or-later OR LicenseRef-Defense-Unicorns-Commercial
includes:
- utils: ./utils.yaml
variables:
- name: FLAVOR
default: upstream
- name: TEAM
default: uds
- name: ENABLE_UDS_RELEASER
default: "false"
- name: BASE_REPO
tasks:
- name: package
description: Publish the UDS package for the supplied architecture
inputs:
path:
description: Path to the zarf package being published
default: .
version:
description: The version of the package to publish
default: ${VERSION}
architecture:
description: The architecture of the package to publish
default: ${UDS_ARCH}
team:
description: The team publishing the package
default: uds
name:
description: The name of the package to publish
default: ${PACKAGE_NAME}
actions:
- if: ${{ eq .variables.ENABLE_UDS_RELEASER "false" }}
task: release-please-publish
with:
path: ${{ .inputs.path }}
version: ${{ .inputs.version }}
architecture: ${{ .inputs.architecture }}
team: ${{ .inputs.team }}
name: ${{ .inputs.name }}
- if: ${{ eq .variables.ENABLE_UDS_RELEASER "true" }}
task: uds-releaser-publish
with:
path: ${{ .inputs.path }}
architecture: ${{ .inputs.architecture }}
team: ${{ .inputs.team }}
name: ${{ .inputs.name }}
- name: release-please-publish
description: Publish the UDS package using release-please based workflows
inputs:
path:
description: Path to the zarf package being published
default: .
version:
description: The version of the package to publish
required: true
architecture:
description: The architecture of the package to publish
default: ${UDS_ARCH}
team:
description: The team publishing the package
default: uds
name:
description: The name of the package to publish
default: ${PACKAGE_NAME}
actions:
- task: utils:determine-repo
with:
team: ${{ .variables.TEAM }}
base_repo: ${{ .variables.BASE_REPO }}
- description: Get the current Zarf package name
cmd: cat ${{ .inputs.path }}/zarf.yaml | ./uds zarf tools yq .metadata.name
setVariables:
- name: PACKAGE_NAME
- description: Publish package for the supplied architecture
cmd: |
./uds zarf package publish "${{ .inputs.path }}/zarf-package-${{ .inputs.name }}-${{ .inputs.architecture }}-${{ .inputs.version }}.tar.zst" "oci://${TARGET_REPO}"
- name: uds-releaser-publish
description: Publish the UDS package using uds-releaser based workflows
inputs:
path:
description: Path to the zarf package being published
default: .
architecture:
description: The architecture of the package to publish
default: ${UDS_ARCH}
team:
description: The team publishing the package
default: uds
name:
description: The name of the package to publish
default: ${PACKAGE_NAME}
actions:
- task: utils:determine-repo
with:
team: ${{ .variables.TEAM }}
base_repo: ${{ .variables.BASE_REPO }}
- description: Get the current Zarf package name
cmd: cat ${{ .inputs.path }}/zarf.yaml | ./uds zarf tools yq .metadata.name
setVariables:
- name: PACKAGE_NAME
- description: publish using uds-releaser
cmd: |
./uds zarf package publish "${{ .inputs.path }}/zarf-package-${{ .inputs.name }}-${{ .inputs.architecture }}-$(uds-releaser show ${{ .variables.FLAVOR }} --version-only).tar.zst" "oci://${TARGET_REPO}"
if [ -n "${GITLAB_CI}" ]; then
uds-releaser release gitlab "${{ .variables.FLAVOR }}"
elif [ -n "${GITHUB_ACTION}" ]; then
uds-releaser release github "${{ .variables.FLAVOR }}"
else
echo "Unsupported platform"
exit 11
fi
- name: test-bundle
description: Publish the test bundle for the supplied architecture
inputs:
path:
description: Path to the UDS bundle being published
default: bundle
version:
description: The version of the bundle to publish
default: ${BUNDLE_VERSION}
architecture:
description: The architecture of the bundle to publish
default: ${UDS_ARCH}
name:
description: The name of the bundle to publish
default: ${BUNDLE_NAME}
actions:
- task: utils:determine-repo
with:
base_repo: ${{ .variables.BASE_REPO }}
- description: Get the current UDS Bundle name
cmd: cat ${{ .inputs.path }}/uds-bundle.yaml | ./uds zarf tools yq .metadata.name
setVariables:
- name: BUNDLE_NAME
- description: Get the current UDS Bundle version
cmd: cat ${{ .inputs.path }}/uds-bundle.yaml | ./uds zarf tools yq .metadata.version
setVariables:
- name: BUNDLE_VERSION
- description: Publish bundle for the supplied architecture
cmd: |
./uds publish "${{ .inputs.path }}/uds-bundle-${{ .inputs.name }}-${{ .inputs.architecture }}-${{ .inputs.version }}.tar.zst" "oci://${TARGET_REPO}/bundles" --no-progress