-
Notifications
You must be signed in to change notification settings - Fork 9
76 lines (75 loc) · 2.41 KB
/
release_workflow.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
name: Build and Publish Release
run-name: Build and publish release${{ github.event.inputs.upload_wheel == 'true' && ' - Wheel upload' || ''}}${{ github.event.inputs.github_release == 'true' && ' - Stage Release' || ''}}
permissions:
contents: read
on:
# only manual trigger
workflow_dispatch:
inputs:
continue-on-error:
description: Continue release if pre-checks fail
type: boolean
required: false
default: false
github_release:
description: Stage github release
type: boolean
required: false
default: false
upload_wheel:
description: Upload wheel to storage
type: boolean
required: false
default: false
jobs:
security:
permissions:
contents: read
security-events: write
id-token: write
uses: ./.github/workflows/security_checks.yml
with:
continue-on-error: ${{ github.event.inputs.continue-on-error == 'true' }}
build:
uses: ./.github/workflows/release_build.yml
test:
uses: ./.github/workflows/tox.yml
with:
continue-on-error: ${{ github.event.inputs.continue-on-error == 'true' }}
azdev_linter:
needs: [build]
uses: ./.github/workflows/azdev_linter.yml
with:
continue-on-error: ${{ github.event.inputs.continue-on-error == 'true' }}
approval:
needs: [security, build, test, azdev_linter]
# only needed if (release || wheel)
if: (github.event.inputs.github_release == 'true' || github.event.inputs.upload_wheel == 'true')
environment: production
runs-on: ubuntu-latest
steps:
- name: Confirm
run: |
echo "Approved" >> $GITHUB_STEP_SUMMARY
if [ "${{ inputs.upload_wheel }}" == "true" ]; then
echo "Wheel will be uploaded to storage account." >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ inputs.github_release }}" == "true" ]; then
echo "Github release will be drafted." >> $GITHUB_STEP_SUMMARY
fi
# github_release == 'true'
draft_github_release:
permissions:
contents: write
needs: [approval]
if: github.event.inputs.github_release == 'true'
uses: ./.github/workflows/stage_release.yml
secrets: inherit
# upload_wheel == 'true'
upload_wheel:
permissions:
id-token: write
needs: [approval]
if: github.event.inputs.upload_wheel == 'true'
uses: ./.github/workflows/upload_wheel.yml
secrets: inherit