-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.43 KB
/
release-orchestrate.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
name: Release Orchestration
permissions:
actions: read
contents: read
on:
workflow_dispatch:
inputs:
build-variant:
description: "Build Variant"
type: choice
default: "dev"
options:
- dev
- alpha
- beta
- rc
- release
env:
PYTHON_VERSION: "3.13"
jobs:
generate-build-number:
name: "Generate build number"
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Generate unique version and build numbers"
id: gen-buildnum
uses: ./.github/actions/version-dot-buildnum-generate
with:
build-variant: ${{ inputs.build-variant }}
- name: "Tag repository"
# Tagging is part of the build number generation in part because
# tag uniqueness serves as a synchronization mechanism to prevent
# multiple releases of the same version.
run: |
set -x
git config --global user.email "[email protected]"
git config --global user.name "CICD for github repository ${GITHUB_REPOSITORY}"
if [ "${{ steps.gen-buildnum.outputs.variant-raw }}" = "release" ]
then
git tag -a -m "test tag comment for final release" "${{steps.gen-buildnum.outputs.version}}"
git push origin "${{steps.gen-buildnum.outputs.version}}"
fi
git tag -a -m "test tag comment" "${{steps.gen-buildnum.outputs.version-with-buildnum}}"
git push origin "${{steps.gen-buildnum.outputs.version-with-buildnum}}"
test:
name: "Prerelease Tests"
uses: ./.github/workflows/test.yml
needs: generate-build-number # Doesn't really need it, but gates the pipeline to not waste time.
package:
name: "Build Release Artifacts"
uses: ./.github/workflows/release-build.yml
needs: [test, generate-build-number]
publish:
name: "Publish Release Artifacts"
uses: ./.github/workflows/release-publish.yml
needs: [package, generate-build-number]
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
PYPI_API_TOKEN_TEST: ${{ secrets.PYPI_API_TOKEN_TEST }}
# with:
# version-with-buildnumber: ${{needs.generate-build-number.outputs.version-with-buildnum}}