@@ -37,128 +37,15 @@ env:
37
37
38
38
jobs :
39
39
prepare-release :
40
- environment : release
41
- name : " Prepare release"
40
+ name : " Testing"
42
41
runs-on : ubuntu-latest
43
- permissions :
44
- id-token : write
45
- contents : write
46
42
47
43
steps :
48
- - name : " Create release output"
49
- run : echo '🎬 Release process for version ${{ inputs.version }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY
50
-
51
- - name : " Generate token and checkout repository"
52
- uses : mongodb-labs/drivers-github-tools/secure-checkout@v2
53
- with :
54
- app_id : ${{ vars.APP_ID }}
55
- private_key : ${{ secrets.APP_PRIVATE_KEY }}
56
-
57
- - name : " Store version numbers in env variables"
58
- run : |
59
- echo RELEASE_VERSION=${{ inputs.version }} >> $GITHUB_ENV
60
- echo RELEASE_BRANCH=v$(echo ${{ inputs.version }} | cut -d '.' -f-2) >> $GITHUB_ENV
61
-
62
- - name : " Ensure release tag does not already exist"
63
- run : |
64
- if [[ $(git tag -l ${RELEASE_VERSION}) == ${RELEASE_VERSION} ]]; then
65
- echo '❌ Release failed: tag for version ${{ inputs.version }} already exists' >> $GITHUB_STEP_SUMMARY
66
- exit 1
67
- fi
68
-
69
- - name : " Fail if branch names don't match"
70
- if : ${{ github.ref_name != env.RELEASE_BRANCH }}
71
- run : |
72
- echo '❌ Release failed due to branch mismatch: expected ${{ inputs.version }} to be released from ${{ env.RELEASE_BRANCH }}, got ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
73
- exit 1
74
-
75
- #
76
- # Preliminary checks done - commence the release process
77
- #
78
-
79
- - name : " Set up drivers-github-tools"
80
- uses : mongodb-labs/drivers-github-tools/setup@v2
81
- with :
82
- aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
83
- aws_region_name : ${{ vars.AWS_REGION_NAME }}
84
- aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
85
-
86
- - name : " Prepare release message"
87
- run : |
88
- cat > release-message <<'EOL'
89
- ${{ format(env.default-release-message, inputs.version, inputs.jira-version-number) }}
90
- EOL
91
-
92
- - name : " Create draft release"
93
- run : echo "RELEASE_URL=$(gh release create ${{ inputs.version }} --target ${{ github.ref_name }} --title "${{ inputs.version }}" --notes-file release-message --draft)" >> "$GITHUB_ENV"
94
-
95
- - name : " Create release tag"
96
- uses : mongodb-labs/drivers-github-tools/tag-version@v2
97
- with :
98
- version : ${{ inputs.version }}
99
- tag_message_template : ' Release ${VERSION}'
100
-
101
- # TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created
102
- # Process is:
103
- # 1. switch to next branch (according to merge-up action)
104
- # 2. merge release branch using --strategy=ours
105
- # 3. push next branch
106
- # 4. switch back to release branch, then push
107
-
108
- - name : " Set summary"
109
- run : |
110
- echo '🚀 Created tag and drafted release for version [${{ inputs.version }}](${{ env.RELEASE_URL }})' >> $GITHUB_STEP_SUMMARY
111
- echo '✍️ You may now update the release notes and publish the release when ready' >> $GITHUB_STEP_SUMMARY
112
-
113
- static-analysis :
114
- needs : prepare-release
115
- name : " Run Static Analysis"
116
- uses : ./.github/workflows/static-analysis.yml
117
- with :
118
- ref : refs/tags/${{ inputs.version }}
119
- permissions :
120
- security-events : write
121
- id-token : write
122
-
123
- publish-ssdlc-assets :
124
- needs : static-analysis
125
- environment : release
126
- name : " Publish SSDLC Assets"
127
- runs-on : ubuntu-latest
128
- permissions :
129
- security-events : read
130
- id-token : write
131
- contents : write
132
-
133
- steps :
134
- - name : " Generate token and checkout repository"
135
- uses : mongodb-labs/drivers-github-tools/secure-checkout@v2
136
- with :
137
- app_id : ${{ vars.APP_ID }}
138
- private_key : ${{ secrets.APP_PRIVATE_KEY }}
139
- ref : refs/tags/${{ inputs.version }}
140
-
141
- # Sets the S3_ASSETS environment variable used later
142
- - name : " Set up drivers-github-tools"
143
- uses : mongodb-labs/drivers-github-tools/setup@v2
144
- with :
145
- aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
146
- aws_region_name : ${{ vars.AWS_REGION_NAME }}
147
- aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
148
-
149
- - name : " Generate SSDLC Reports"
150
- uses : mongodb-labs/drivers-github-tools/full-report@v2
151
- with :
152
- product_name : " MongoDB PHP Driver (library)"
153
- release_version : ${{ inputs.version }}
154
- silk_asset_group : mongodb-php-driver-library
155
-
156
- - name : " Upload SBOM as release artifact"
157
- run : gh release upload ${{ inputs.version }} ${{ env.S3_ASSETS }}/cyclonedx.sbom.json
158
- continue-on-error : true
159
-
160
- - name : Upload S3 assets
161
- uses : mongodb-labs/drivers-github-tools/upload-s3-assets@v2
162
- with :
163
- version : ${{ inputs.version }}
164
- product_name : mongo-php-library
44
+ - name : " Test output"
45
+ id : set_output
46
+ run : echo "foo=BAR" >> $GITHUB_OUTPUT
47
+ - name : " Print output"
48
+ id : print_output
49
+ run : echo ${{ steps.set_output.outputs.foo }}
50
+ - name : " Print from wrong step"
51
+ run : echo ${{ steps.print_output.outputs.foo }}
0 commit comments