-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (139 loc) · 5.09 KB
/
release.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: (RELEASE)
on:
workflow_dispatch:
inputs:
versionNumber:
description: Release version number
required: true
default: '1.0.0.0'
name:
description: Name of this release (Default is generated package name)
required: true
default: ''
createReleaseBranch:
description: Create Release Branch
required: false
type: boolean
default: false
permissions:
contents: write
pull-requests: write
actions: read
concurrency: release
defaults:
run:
shell: PowerShell
jobs:
Initialization:
runs-on: [ windows-latest ]
outputs:
type: ${{ steps.ReadSettings.outputs.type }}
source_branch: ${{ steps.ReadSettings.outputs.source_branch }}
versions: ${{ steps.ReadSettings.outputs.VersionsJson }}
environments: ${{ steps.ReadSettings.outputs.EnvironmentsJson }}
githubRunner: ${{ steps.ReadSettings.outputs.GitHubRunnerJson }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Initialize the workflow
uses: fscpscollaborative/fscps.gh/[email protected]
id: init
env:
secrets: ${{ toJson(secrets) }}
- name: Read settings
id: ReadSettings
uses: fscpscollaborative/fscps.gh/[email protected]
- name: Check for updates to FSC-PS system files
uses: fscpscollaborative/fscps.gh/[email protected]
continue-on-error: true
with:
type: ${{ steps.ReadSettings.outputs.type }}
settingsJson: ${{ env.Settings }}
secretsJson: ${{ env.RepoSecrets }}
CreateRelease:
runs-on: ${{ fromJson(needs.Initialization.outputs.githubRunner) }}
needs: [ Initialization ]
outputs:
artifact_name: ${{ steps.runpipeline.outputs.PACKAGE_NAME }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Read settings
uses: fscpscollaborative/fscps.gh/[email protected]
- name: Read secrets
uses: fscpscollaborative/fscps.gh/[email protected]
env:
secrets: ${{ toJson(secrets) }}
with:
settingsJson: ${{ env.Settings }}
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '16'
- name: Get Env Vars
run: |
$settingsJson = '${{ env.Settings }}'
$settings = $settingsJson | ConvertFrom-Json
if ($settings) {
Write-Host "Repo type is: $($settings.type)"
Add-Content -Path $env:GITHUB_ENV -Value "type=$($settings.type)"
}
- name: Run pipeline
uses: fscpscollaborative/fscps.gh/[email protected]
id: runpipeline
with:
type: ${{ needs.Initialization.outputs.type}}
settingsJson: ${{ env.Settings }}
secretsJson: ${{ env.RepoSecrets }}
- name: Publish artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: '${{ env.PACKAGE_PATH }}'
- name: Publish Release
id: PublishRelease
uses: fscpscollaborative/fscps.gh/[email protected]
with:
type: ${{ needs.Initialization.outputs.type}}
settingsJson: ${{ env.Settings }}
secretsJson: ${{ env.RepoSecrets }}
artifactsPath: '${{ env.PACKAGE_PATH }}'
CreateReleaseBranch:
if: ${{ github.event.inputs.createReleaseBranch == true }}
runs-on: ${{ fromJson(needs.Initialization.outputs.githubRunner) }}
needs: [ Initialization, CreateRelease ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Read settings
id: ReadSettings
uses: fscpscollaborative/fscps.gh/[email protected]
- name: Create Release Branch
run: |
git checkout -b "releases/${{ github.event.inputs.versionNumber }}"
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
git commit --allow-empty -m "Release branch ${{ github.event.inputs.versionNumber }}"
git push origin "releases/${{ github.event.inputs.versionNumber }}"
PostProcess:
if: ${{ !cancelled() }}
runs-on: ${{ fromJson(needs.Initialization.outputs.githubRunner) }}
needs: [ Initialization, CreateRelease, CreateReleaseBranch ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Read settings
uses: fscpscollaborative/fscps.gh/[email protected]
- name: Read secrets
uses: fscpscollaborative/fscps.gh/[email protected]
env:
secrets: ${{ toJson(secrets) }}
with:
settingsJson: ${{ env.Settings }}
- name: Finalize the workflow
id: PostProcess
uses: fscpscollaborative/fscps.gh/[email protected]
with:
remove_current: ${{ needs.Initialization.outputs.environments == '' }}
settingsJson: ${{ env.Settings }}
secretsJson: ${{ env.RepoSecrets }}