-
Notifications
You must be signed in to change notification settings - Fork 66
62 lines (62 loc) · 2.09 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
name: Build and Publish Release
run-name: Build and publish release${{ github.event.inputs.github_release == 'true' && ' - Stage Release' || ''}}
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
jobs:
security:
permissions:
# needed to write security info to repository
security-events: write
contents: read
uses: ./.github/workflows/security_checks.yml
with:
continue-on-error: ${{ github.event.inputs.continue-on-error == 'true' }}
build:
uses: ./.github/workflows/release_build.yml
unit-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' }}
int_test:
needs: [build]
uses: ./.github/workflows/trigger_ado_int_tests.yml
secrets: inherit
approval:
needs: [security, build, unit-test, azdev_linter]
# only needed if (release || wheel) - conditionals allow previous jobs to be skipped and still run
if: always() && !cancelled() && !failure() && (github.event.inputs.github_release == 'true')
environment: production
runs-on: ubuntu-latest
steps:
- name: Confirm
run: |
echo "Approved" >> $GITHUB_STEP_SUMMARY
if [ "${{ inputs.github_release }}" == "true" ]; then
echo "Github release will be drafted." >> $GITHUB_STEP_SUMMARY
fi
# github_release == 'true'
draft_github_release:
permissions:
# needed to create draft release
contents: write
needs: [approval]
if: always() && !cancelled() && !failure() && github.event.inputs.github_release == 'true'
uses: ./.github/workflows/stage_release.yml
secrets: inherit