Skip to content

Commit

Permalink
chore(release): make official releases pass the integration tests first
Browse files Browse the repository at this point in the history
  • Loading branch information
obs-gh-colinhutchinson committed Nov 20, 2023
1 parent a2258bb commit ca700fe
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,32 @@ env:
S3_BUCKET_PREFIX: observeinc

jobs:
permission_check:
runs-on: ubuntu-latest
outputs:
can-write: ${{ steps.check.outputs.can-write }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
steps:
- id: check
run: |
# If the AWS_ACCESS_KEY_ID secret is MIA we can't run tests
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then
echo "can-write=false" >> $GITHUB_OUTPUT
else
echo "can-write=true" >> $GITHUB_OUTPUT
fi
tests:
needs: permission_check
uses: ./.github/workflows/tests-integration.yaml
if: needs.permission_check.outputs.can-write == 'true'
secrets: inherit

fetch-regions:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
needs: permission_check
if: needs.permission_check.outputs.can-write == 'true'
permissions:
id-token: write
outputs:
Expand All @@ -39,8 +62,11 @@ jobs:
run: echo "matrix=${regions_json}" >> "$GITHUB_OUTPUT"

github-release:
needs: [tests, permission_check]
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
if: >
(needs.permission_check.outputs.can-write == 'true' && github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && needs.tests.result == 'success')
outputs:
version: ${{ steps.release-version.outputs.VERSION }}
steps:
Expand Down Expand Up @@ -73,7 +99,7 @@ jobs:
VERSION: ${{ (steps.prerelease.outputs.release-version != '') && steps.prerelease.outputs.release-version || steps.fullrelease.outputs.release-version }}

aws-release:
needs: [fetch-regions, github-release]
needs: [fetch-regions, github-release, tests]
runs-on: ubuntu-latest
if: |
github.actor != 'dependabot[bot]' &&
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

jobs:
permission_check:
runs-on: ubuntu-latest
Expand Down

0 comments on commit ca700fe

Please sign in to comment.