-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (124 loc) · 4.6 KB
/
release-candidate.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
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
name: PCO-Release - Release Candidate Automation
on:
workflow_call:
inputs:
install-command:
description: "The script command to use to install the package's dependencies"
required: false
type: string
default: "yarn install --check-files"
build-command:
description: "The script command to use to build the package"
required: false
type: string
default: "yarn build"
test-command:
description: "The script command to use to test the package"
required: false
type: string
default: "yarn test"
prepublish-command:
description: "The command to run to publish a prerelease version of the package to NPM"
required: false
type: string
default: "npm publish --tag next"
cache:
description: "Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm, or '' for no caching."
required: false
type: string
default: "yarn"
build-directory:
description: "The build output directory"
required: false
type: string
default: "dist"
only:
description: "Only run on specific repos. This is a comma separated list of repo names (ie 'people,services,groups')"
required: false
type: string
default: ""
include:
description: "repos to include without checking. Comma separated list"
required: false
type: string
default: ""
exclude:
description: "repos to exclude without checking. Comma separated list"
required: false
type: string
default: ""
upgrade-commands:
description: "JSON string of repo names and their specific upgrade commands. Useful for monorepos where the package.json does not exist in the root directory."
required: false
type: string
default: "{}"
package-json-path:
description: "path to package.json"
required: false
type: string
default: "package.json"
yarn-version-command:
description: "command to run to update version"
required: false
type: string
default: "yarn version"
jobs:
create-rc-release:
if: github.event.issue.pull_request && contains(github.event.comment.body, '@pco-release rc')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Create Release Candidate Pre-Release
id: create-rc-release
uses: planningcenter/pco-release-action/create-release-candidate@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package-json-path: ${{ inputs.package-json-path }}
yarn-version-command: ${{ inputs.yarn-version-command }}
outputs:
release-tag: v${{ env.new_version }}
publish-to-npm:
needs: create-rc-release
uses: planningcenter/pco-release-action/.github/workflows/publish.yml@v1
secrets: inherit
with:
install-command: ${{ inputs.install-command }}
build-command: ${{ inputs.build-command }}
test-command: ${{ inputs.test-command }}
prepublish-command: ${{ inputs.prepublish-command }}
cache: ${{ inputs.cache }}
build-directory: ${{ inputs.build-directory }}
ref: ${{ needs.create-rc-release.outputs.release-tag }}
prerelease: true
deploy-to-staging-for-consumers:
needs: [create-rc-release, publish-to-npm]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Push to `staging` for Consumers
uses: planningcenter/pco-release-action/deploy@v1
if: ${{ !contains(github.event.comment.body, '--no-deploy') }}
with:
app-id: ${{ secrets.PCO_DEPENDENCIES_APP_ID }}
private-key: ${{ secrets.PCO_DEPENDENCIES_PRIVATE_KEY }}
ref: ${{ needs.create-rc-release.outputs.release-tag }}
change-method: "merge"
branch-name: "staging"
only: ${{ inputs.only }}
exclude: ${{ inputs.exclude }}
include: ${{ inputs.include }}
upgrade-commands: ${{ inputs.upgrade-commands }}
allow-major: true
package-json-path: ${{ inputs.package-json-path }}
- name: Post results to original PR
uses: planningcenter/pco-release-action/reporting@v1
with:
pr-number: ${{ github.event.issue.number }}
results-json: ${{ env.results_json }}
version-tag: ${{ needs.create-rc-release.outputs.release-tag }}
actor: ${{ github.actor }}
release-type: "RC"