Skip to content

Commit d7de810

Browse files
committed
ci(release): refine documentation and add version pinning
1 parent 9865b81 commit d7de810

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,38 @@ on:
66
branches:
77
- main
88

9+
# The different jobs of this workflow need the following permissions
910
permissions:
11+
# The release-please-action requires these permissions to create a github release
1012
contents: write
13+
# The release-please-action requires these permissions to create and modify pull requests
1114
pull-requests: write
15+
# The release-please-action requires these permissions to read pull request labels
1216
repository-projects: read
13-
# only required for workflows in private repositories
17+
# This workflow calls and imports multiple other workflows and actions. T
18+
# It is only required for workflows in private repositories
1419
actions: write
20+
# The release workflow calls multiple code quality and security workflows which create security output
1521
security-events: write
16-
# required to fetch internal or private CodeQL packs
22+
# This is required to fetch internal or private CodeQL packs
1723
packages: read
1824

25+
# This workflow is part of the release group and will not run concurrently with other workflows in the same group
1926
concurrency:
2027
group: release
2128

2229
jobs:
2330
# This job creates the necessary labels for the release-please PRs:
31+
# GitHub introduced a situation where these labels are not created which caused the release-please-action to fail.
32+
# googleapis underlying release-please needs to add a check for the existence of these labels,
33+
# and create them if they are not present.
2434
# https://github.com/googleapis/release-please-action/issues/1074
2535
label-check:
2636
name: Create release-please PR labels
2737
runs-on: ubuntu-latest
2838
steps:
2939
- name: Checkout
30-
uses: actions/checkout@v4
40+
uses: actions/checkout@v4.2.2
3141

3242
- name: Add labels to the repository if not present
3343
env:
@@ -70,7 +80,9 @@ jobs:
7080
runs-on: ubuntu-latest
7181
needs: [ label-check, initial-e2e-test, mobsf, swiftlint, codeql-package, codeql-samples-quickstart ]
7282
outputs:
83+
# This output is used to determine if a release was created
7384
releases_created: ${{ steps.release.outputs.releases_created }}
85+
# This output is used to determine the tag name of the release
7486
tag_name: ${{ steps.release.outputs.tag_name }}
7587
steps:
7688
- id: release
@@ -84,8 +96,9 @@ jobs:
8496
prerelease-test:
8597
name: Run Prerelease Tests
8698
runs-on: ubuntu-latest
87-
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
8899
needs: [ prerelease-prep ]
100+
# This job runs only if there was no release created
101+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
89102
steps:
90103
- name: End To End Test
91104
run: |
@@ -94,23 +107,26 @@ jobs:
94107
# This job runs the E2E tests with FusionAuth Matrix as a prerequisite for creating the prerelease
95108
prerelease-e2e-test-fusionauth-matrix:
96109
name: Run Prerelease E2E Tests with FusionAuth Matrix
97-
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
98110
needs: [ prerelease-prep ]
111+
# This job runs only if there was no release created
112+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
99113
uses: ./.github/workflows/e2e-test-fusionauth-matrix-ios-latest.yml
100114

101115
# This job runs the E2E tests with iOS Matrix as a prerequisite for creating the prerelease
102116
prerelease-e2e-test-ios-matrix:
103117
name: Run Prerelease E2E Tests with iOS Matrix
104-
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
105118
needs: [ prerelease-prep ]
119+
# This job runs only if there was no release created
120+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'false' }}
106121
uses: ./.github/workflows/e2e-test-fusionauth-latest-ios-matrix.yml
107122

108123
# This job runs creates the Prerelease and creates a subsequent Release Pull Request
109124
prerelease:
110125
name: Create Prerelease and Release Pull Request
111126
runs-on: ubuntu-latest
112-
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
113127
needs: [ prerelease-prep, prerelease-e2e-test-fusionauth-matrix, prerelease-e2e-test-ios-matrix ]
128+
# This job runs only if a release was created and the tag name contains 'rc'
129+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
114130
steps:
115131
- name: Pre Release Step
116132
run: |
@@ -127,6 +143,7 @@ jobs:
127143
name: Post Prerelease Steps
128144
runs-on: ubuntu-latest
129145
needs: [ prerelease ]
146+
# This job runs only if a release was created and the tag name contains 'rc'
130147
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
131148
steps:
132149
- name: Post Prerelease Step
@@ -137,8 +154,9 @@ jobs:
137154
release:
138155
name: Create Release
139156
runs-on: ubuntu-latest
140-
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && !contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
141157
needs: [ prerelease-prep ]
158+
# This job runs only if a release was created and the tag name does not contain 'rc'
159+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && !contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
142160
steps:
143161
- name: Release Step
144162
run: |
@@ -168,6 +186,8 @@ jobs:
168186
name: Post Release Steps
169187
runs-on: ubuntu-latest
170188
needs: [ release ]
189+
# This job runs only if a release was created and the tag name does not contain 'rc'
190+
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && !contains(needs.prerelease-prep.outputs.tag_name, 'rc') }}
171191
steps:
172192
- name: Post Release Step
173193
run: |

0 commit comments

Comments
 (0)