5
5
# Trigger build(s) on specified branch, git action:
6
6
pull_request :
7
7
types : [opened, closed, synchronize]
8
- branches :
8
+ branches :
9
9
- ' development'
10
10
- ' master'
11
11
@@ -24,78 +24,77 @@ jobs:
24
24
uses : ./.github/workflows/test_python_flake.yaml
25
25
secrets : inherit
26
26
27
- unittest :
28
- needs :
29
- - flake
30
- uses : ./.github/workflows/test_python_tests.yaml
31
- secrets : inherit
32
-
33
27
approve_development :
34
28
needs :
35
29
- flake
36
- - unittest
37
30
uses : ./.github/workflows/auto_approve.yaml
38
31
secrets : inherit
39
32
40
- deployment_question :
33
+ unittest :
41
34
if : |
42
35
github.event_name == 'pull_request' &&
43
36
github.event.pull_request.merged == true &&
44
37
github.ref == 'refs/heads/development' &&
45
38
github.event.action == 'closed'
39
+ uses : ./.github/workflows/test_python_tests.yaml
40
+ secrets : inherit
41
+
42
+ deployment_question :
43
+ needs :
44
+ - unittest
46
45
runs-on : self-hosted
47
46
steps :
48
- - name : Checkout
49
- uses : actions/checkout@v3
50
- with :
51
- fetch-depth : 0
52
- - id : string
53
- uses : ASzc/change-string-case-action@v5
54
- with :
55
- string : ${{github.event.repository.name}}
56
- - name : Create Pull Request
57
- id : cpr
58
- uses : actions/github-script@v6
59
- with :
60
- script : |
61
- const { repo, owner } = context.repo;
62
- const result = await github.rest.pulls.create({
63
- title: 'Deploy A Proxy Relay Package? - ${{ github.run_number }}',
64
- owner,
65
- repo,
66
- head: '${{ github.ref_name }}',
67
- base: 'master',
68
- body: [
69
- 'Would you like to release a new build of aproxyrelay ?\n',
70
- 'Update A Proxy Relay to latest',
71
- '---',
72
- 'Build and release new version!',
73
- ].join('\n'),
74
- assignees: '@0x78f1935',
75
- reviewers: '@0x78f1935',
76
- });
77
- github.rest.issues.addLabels({
78
- owner,
79
- repo,
80
- issue_number: result.data.number,
81
- labels: ['docker', 'automated', 'prod-deployment'],
82
- });
83
- const os = require("os");
84
- const fs = require("fs");
47
+ - name : Checkout
48
+ uses : actions/checkout@v3
49
+ with :
50
+ fetch-depth : 0
51
+ - id : string
52
+ uses : ASzc/change-string-case-action@v5
53
+ with :
54
+ string : ${{github.event.repository.name}}
55
+ - name : Create Pull Request
56
+ id : cpr
57
+ uses : actions/github-script@v6
58
+ with :
59
+ script : |
60
+ const { repo, owner } = context.repo;
61
+ const result = await github.rest.pulls.create({
62
+ title: 'Deploy A Proxy Relay Package? - ${{ github.run_number }}',
63
+ owner,
64
+ repo,
65
+ head: '${{ github.ref_name }}',
66
+ base: 'master',
67
+ body: [
68
+ 'Would you like to release a new build of aproxyrelay ?\n',
69
+ 'Update A Proxy Relay to latest',
70
+ '---',
71
+ 'Build and release new version!',
72
+ ].join('\n'),
73
+ assignees: '@0x78f1935',
74
+ reviewers: '@0x78f1935',
75
+ });
76
+ github.rest.issues.addLabels({
77
+ owner,
78
+ repo,
79
+ issue_number: result.data.number,
80
+ labels: ['docker', 'automated', 'prod-deployment'],
81
+ });
82
+ const os = require("os");
83
+ const fs = require("fs");
85
84
86
- function setOutput(key, value) {
87
- // Temporary hack until core actions library catches up with github new recommendations
88
- const output = process.env['GITHUB_OUTPUT']
89
- fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
90
- };
91
- setOutput('pr_id', result.data.number);
85
+ function setOutput(key, value) {
86
+ // Temporary hack until core actions library catches up with github new recommendations
87
+ const output = process.env['GITHUB_OUTPUT']
88
+ fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
89
+ };
90
+ setOutput('pr_id', result.data.number);
92
91
93
92
deploy_package :
94
93
if : github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'prod-deployment')
95
94
timeout-minutes : 30
96
95
runs-on : self-hosted
97
96
environment : production
98
- permissions :
97
+ permissions :
99
98
id-token : write
100
99
contents : write
101
100
pull-requests : write
@@ -126,8 +125,8 @@ jobs:
126
125
id : release
127
126
uses : ncipollo/release-action@v1
128
127
with :
129
- artifacts : " dist/aproxyrelay-*.tar.gz,dist/aproxyrelay-*.whl"
130
- bodyFile : " README.md"
128
+ artifacts : ' dist/aproxyrelay-*.tar.gz,dist/aproxyrelay-*.whl'
129
+ bodyFile : ' README.md'
131
130
generateReleaseNotes : true
132
131
makeLatest : true
133
132
token : ${{ secrets.PERSONAL_GITHUB_ACTIONS_TOKEN }}
0 commit comments