-
Notifications
You must be signed in to change notification settings - Fork 38
172 lines (156 loc) · 5.19 KB
/
Copy pathrelease_publish.yml
File metadata and controls
172 lines (156 loc) · 5.19 KB
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
name: "Release: Publish"
run-name: "Release: Publish ${{ inputs.tag || 'next pending release' }}"
on:
schedule:
# Check at 00:17, 06:17, 12:17, and 18:17 UTC.
- cron: "17 */6 * * *"
workflow_dispatch:
inputs:
tag:
description: Specific pending release tag to check
required: false
type: string
force_publish:
description: Bypass Conda availability after release-gate approval (requires tag)
required: false
default: false
type: boolean
concurrency:
group: release
permissions:
contents: read
jobs:
CheckConda:
if: github.repository == 'aws-deadline/deadline-cloud-for-cinema-4d'
runs-on: ubuntu-latest
outputs:
ready: ${{ steps.readiness.outputs.ready }}
tag: ${{ steps.readiness.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Check release readiness
id: readiness
uses: aws-deadline/.github/.github/actions/check-release-readiness@mainline
with:
github-token: ${{ github.token }}
requested-tag: ${{ inputs.tag }}
force-publish: ${{ inputs.force_publish }}
package-name: cinema4d-openjd
required-platforms: linux-64,win-64
timeout-days: 4
ApproveManifestOverride:
needs: CheckConda
if: >-
inputs.force_publish == true &&
needs.CheckConda.outputs.tag != '' &&
needs.CheckConda.outputs.ready != 'true'
runs-on: ubuntu-latest
environment: release-gate
permissions: {}
steps:
- name: Record approved override
env:
TAG: ${{ needs.CheckConda.outputs.tag }}
run: |
echo "Conda manifest override approved for release $TAG."
{
echo "### Conda manifest override"
echo
printf 'Release `%s` was approved without a published Conda package.\n' "$TAG"
} >> "$GITHUB_STEP_SUMMARY"
AuthorizePublish:
needs: [CheckConda, ApproveManifestOverride]
if: >-
always() &&
needs.CheckConda.result == 'success' &&
needs.CheckConda.outputs.tag != '' &&
(
needs.CheckConda.outputs.ready == 'true' ||
needs.ApproveManifestOverride.result == 'success'
)
runs-on: ubuntu-latest
permissions: {}
outputs:
tag: ${{ steps.release.outputs.tag }}
steps:
- name: Authorize public release
id: release
env:
TAG: ${{ needs.CheckConda.outputs.tag }}
run: echo "tag=$TAG" >> "$GITHUB_OUTPUT"
ValidateRelease:
needs: AuthorizePublish
if: needs.AuthorizePublish.outputs.tag != ''
uses: aws-deadline/.github/.github/workflows/reusable_tag_release.yml@mainline
permissions:
contents: read
secrets: inherit
with:
tag: ${{ needs.AuthorizePublish.outputs.tag }}
PreRelease:
needs: ValidateRelease
if: needs.ValidateRelease.outputs.tag != ''
uses: aws-deadline/.github/.github/workflows/reusable_prerelease.yml@mainline
permissions:
id-token: write
contents: write
secrets: inherit
with:
tag: ${{ needs.ValidateRelease.outputs.tag }}
ReleaseInstaller:
needs: [ValidateRelease, PreRelease]
if: needs.ValidateRelease.outputs.tag != ''
uses: aws-deadline/.github/.github/workflows/reusable_release_installers.yml@mainline
secrets: inherit
permissions:
id-token: write
contents: read
with:
tag: ${{ needs.ValidateRelease.outputs.tag }}
oses: "['Windows', 'MacOS']"
project_name: ${{ github.event.repository.name }}
# Create the completion marker before PyPI so scheduled retries cannot
# repeatedly release installers. Recover PyPI by rerunning this run's failed job.
Release:
needs: [ValidateRelease, PreRelease, ReleaseInstaller]
if: needs.ValidateRelease.outputs.tag != ''
uses: aws-deadline/.github/.github/workflows/reusable_release.yml@mainline
secrets: inherit
permissions:
id-token: write
contents: write
with:
tag: ${{ needs.ValidateRelease.outputs.tag }}
# PyPI does not support reusable workflows yet.
# See https://github.com/pypi/warehouse/issues/11096
PublishToPyPI:
needs: [ValidateRelease, Release]
if: needs.ValidateRelease.outputs.tag != ''
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.ValidateRelease.outputs.tag }}
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ needs.ValidateRelease.outputs.build-python-version }}
- name: Install dependencies
run: pip install --upgrade hatch
- name: Build
run: hatch -v build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
skip-existing: true