|
17 | 17 | name: Prepare environment |
18 | 18 | runs-on: "ubuntu-latest" |
19 | 19 | outputs: |
20 | | - requires_tests: ${{ github.event_name == 'schedule' || steps.changed-files.outputs.any_changed == 'true' || steps.changed-files.outputs.any_deleted == 'true' || steps.changed-files.outputs.any_modified == 'true' }} |
| 20 | + requires_tests: ${{ github.event_name == 'schedule' || steps.changed-files.outputs.any_changed == 'true' || steps.changed-files.outputs.any_deleted == 'true' || steps.changed-files.outputs.any_modified == 'true' || env.PUBLISH_RELEASE == 'true' }} |
| 21 | + publish_release: ${{ env.PUBLISH_RELEASE }} |
| 22 | + release_version: ${{ env.RELEASE_VERSION }} |
| 23 | + release_desc: ${{ env.RELEASE_DESC }} |
21 | 24 | steps: |
22 | 25 | - name: Checkout current commit |
23 | 26 | uses: "actions/checkout@v3" |
|
33 | 36 | tests/** |
34 | 37 | .github/workflows/build.yaml |
35 | 38 |
|
| 39 | + - name: Check if a new release should be published |
| 40 | + if: github.event_name == 'push' |
| 41 | + env: |
| 42 | + GITHUB_EVENT: ${{ toJSON(github.event) }} |
| 43 | + run: | |
| 44 | + .github/workflows/scripts/release.py --printenv | tee -a "$GITHUB_ENV" |
| 45 | +
|
| 46 | +
|
36 | 47 | unit-integration-tests: |
37 | 48 | name: Unit & integration tests |
38 | 49 | runs-on: "ubuntu-latest" |
@@ -202,13 +213,73 @@ jobs: |
202 | 213 | pytest --cache-clear tests/end-to-end/ |
203 | 214 |
|
204 | 215 |
|
| 216 | + update_changelog: |
| 217 | + name: Update changelog |
| 218 | + runs-on: "ubuntu-latest" |
| 219 | + |
| 220 | + needs: |
| 221 | + - prepare-env |
| 222 | + - unit-integration-tests |
| 223 | + - end-to-end-tests |
| 224 | + |
| 225 | + if: github.event_name == 'push' && needs.prepare-env.outputs.publish_release != 'true' && needs.unit-integration-tests.result != 'failure' && needs.end-to-end-tests.result != 'failure' |
| 226 | + |
| 227 | + steps: |
| 228 | + - name: Checkout current commit |
| 229 | + uses: "actions/checkout@v3" |
| 230 | + |
| 231 | + - name: Update changelog for future release |
| 232 | + env: |
| 233 | + GITHUB_EVENT: ${{ toJSON(github.event) }} |
| 234 | + run: | |
| 235 | + .github/workflows/scripts/release.py --update-changelog |
| 236 | +
|
| 237 | + - name: Commit changes |
| 238 | + uses: stefanzweifel/git-auto-commit-action@v4 |
| 239 | + with: |
| 240 | + file_pattern: "info.md" |
| 241 | + commit_message: 📒 Update changelog for future release |
| 242 | + |
| 243 | + |
| 244 | + push_release: |
| 245 | + name: Release version |
| 246 | + runs-on: ubuntu-latest |
| 247 | + |
| 248 | + needs: |
| 249 | + - prepare-env |
| 250 | + - unit-integration-tests |
| 251 | + - end-to-end-tests |
| 252 | + |
| 253 | + if: github.event_name == 'push' && needs.prepare-env.outputs.publish_release == 'true' && needs.unit-integration-tests.result != 'failure' && needs.end-to-end-tests.result != 'failure' |
| 254 | + |
| 255 | + permissions: |
| 256 | + contents: write |
| 257 | + |
| 258 | + steps: |
| 259 | + - name: Checkout current commit |
| 260 | + uses: "actions/checkout@v3" |
| 261 | + |
| 262 | + - name: Release version |
| 263 | + uses: ncipollo/release-action@v1 |
| 264 | + with: |
| 265 | + tag: v${{ needs.prepare-env.outputs.release_version }} |
| 266 | + name: v${{ needs.prepare-env.outputs.release_version }} |
| 267 | + body: ${{ needs.prepare-env.outputs.release_desc }} |
| 268 | + commit: main |
| 269 | + makeLatest: true |
| 270 | + skipIfReleaseExists: true |
| 271 | + |
| 272 | + |
205 | 273 | auto-merge: |
206 | 274 | name: "Auto-merge Dependabot pull requests" |
207 | 275 | runs-on: ubuntu-latest |
| 276 | + |
208 | 277 | needs: |
209 | 278 | - unit-integration-tests |
210 | 279 | - end-to-end-tests |
| 280 | + |
211 | 281 | if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' && needs.unit-integration-tests.result != 'failure' && needs.end-to-end-tests.result != 'failure' |
| 282 | + |
212 | 283 | steps: |
213 | 284 | - name: Checkout current commit |
214 | 285 | uses: "actions/checkout@v3" |
|
0 commit comments