diff --git a/.github/workflows/on_release_notes.yml b/.github/workflows/on_release_notes.yml index 2b431defff0..8d6754b88a0 100644 --- a/.github/workflows/on_release_notes.yml +++ b/.github/workflows/on_release_notes.yml @@ -25,12 +25,14 @@ env: on: release: + # We can't filter by tag here, so we filter later on the first job types: [published] + workflow_dispatch: inputs: version_to_publish: description: "Version to be released in PyPi, Docs, and Lambda Layer, e.g. v1.26.4" - default: v1.26.4 + default: v2.0.0 required: true skip_pypi: description: "Skip publishing to PyPi as it can't publish more than once. Useful for semi-failed releases" @@ -45,6 +47,7 @@ on: jobs: release: + if: ${{ startsWith(github.ref, 'refs/tags/v2') }} environment: release runs-on: ubuntu-latest permissions: @@ -121,6 +124,12 @@ jobs: alias: latest detached_mode: true + publish_layer: + needs: release + uses: ./.github/workflows/publish_v2_layer.yml + with: + latest_published_version: ${{ needs.release.outputs.RELEASE_VERSION }} + post_release: needs: release permissions: diff --git a/.github/workflows/publish_layer.yml b/.github/workflows/publish_layer.yml deleted file mode 100644 index 564cbfad9de..00000000000 --- a/.github/workflows/publish_layer.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Deploy layer to all regions - -permissions: - id-token: write - contents: read - -on: - workflow_dispatch: - inputs: - latest_published_version: - description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0" - default: "v1.22.0" - required: true - workflow_run: - workflows: ["Publish to PyPi"] - types: - - completed - -jobs: - build-layer: - runs-on: ubuntu-latest - if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }} - defaults: - run: - working-directory: ./layer - steps: - - name: checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Install poetry - run: pipx install poetry - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "16.12" - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: "3.9" - cache: "pip" - - name: Resolve and install project dependencies - # CDK spawns system python when compiling stack - # therefore it ignores both activated virtual env and cached interpreter by GH - run: | - poetry export --format requirements.txt --output requirements.txt - pip install -r requirements.txt - - name: Set release notes tag - run: | - RELEASE_INPUT=${{ inputs.latest_published_version }} - LATEST_TAG=$(git describe --tag --abbrev=0) - RELEASE_TAG_VERSION=${RELEASE_INPUT:-$LATEST_TAG} - echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV - - name: install cdk and deps - run: | - npm install -g aws-cdk@2.29.0 - cdk --version - - name: CDK build - run: cdk synth --context version=$RELEASE_TAG_VERSION -o cdk.out - - name: zip output - run: zip -r cdk.out.zip cdk.out - - name: Archive CDK artifacts - uses: actions/upload-artifact@v3 - with: - name: cdk-layer-artefact - path: layer/cdk.out.zip - - deploy-beta: - needs: - - build-layer - uses: ./.github/workflows/reusable_deploy_layer_stack.yml - secrets: inherit - with: - stage: "BETA" - artefact-name: "cdk-layer-artefact" - environment: "layer-beta" - - deploy-prod: - needs: - - deploy-beta - uses: ./.github/workflows/reusable_deploy_layer_stack.yml - secrets: inherit - with: - stage: "PROD" - artefact-name: "cdk-layer-artefact" - environment: "layer-prod" diff --git a/.github/workflows/publish_v2_layer.yml b/.github/workflows/publish_v2_layer.yml index 77f1f9dc627..738dd0bead1 100644 --- a/.github/workflows/publish_v2_layer.yml +++ b/.github/workflows/publish_v2_layer.yml @@ -10,15 +10,16 @@ on: latest_published_version: description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0" required: true - # workflow_run: - # workflows: ["Publish to PyPi"] - # types: - # - completed + workflow_call: + inputs: + latest_published_version: + type: string + description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0" + required: true jobs: build-layer: runs-on: ubuntu-latest - if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }} defaults: run: working-directory: ./layer @@ -74,8 +75,7 @@ jobs: path: layer/cdk.out.zip deploy-beta: - needs: - - build-layer + needs: build-layer uses: ./.github/workflows/reusable_deploy_v2_layer_stack.yml secrets: inherit with: @@ -84,16 +84,15 @@ jobs: environment: "layer-beta" latest_published_version: ${{ inputs.latest_published_version }} - # deploy-prod: - # needs: - # - deploy-beta - # uses: ./.github/workflows/reusable_deploy_layer_stack.yml - # secrets: inherit - # with: - # stage: "PROD" - # artefact-name: "cdk-layer-artefact" - # environment: "layer-prod" - # latest_published_version: ${{ inputs.latest_published_version }} + deploy-prod: + needs: deploy-beta + uses: ./.github/workflows/reusable_deploy_v2_layer_stack.yml + secrets: inherit + with: + stage: "PROD" + artefact-name: "cdk-layer-artefact" + environment: "layer-prod" + latest_published_version: ${{ inputs.latest_published_version }} deploy-sar-beta: needs: build-layer diff --git a/.github/workflows/rebuild_latest_docs.yml b/.github/workflows/rebuild_latest_docs.yml index eb995d95a12..1e8333d4540 100644 --- a/.github/workflows/rebuild_latest_docs.yml +++ b/.github/workflows/rebuild_latest_docs.yml @@ -10,8 +10,8 @@ on: workflow_dispatch: inputs: latest_published_version: - description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.26.7" - default: "v1.28.0" + description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0" + default: "v2.0.0" required: true jobs: diff --git a/.github/workflows/reusable_deploy_layer_stack.yml b/.github/workflows/reusable_deploy_layer_stack.yml deleted file mode 100644 index 20d69b9c814..00000000000 --- a/.github/workflows/reusable_deploy_layer_stack.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Deploy cdk stack - -permissions: - id-token: write - contents: read - -on: - workflow_call: - inputs: - stage: - description: "Deployment stage (BETA, PROD)" - required: true - type: string - artefact-name: - description: "CDK Layer Artefact name to download" - required: true - type: string - environment: - description: "GitHub Environment to use for encrypted secrets" - required: true - type: string - -jobs: - deploy-cdk-stack: - runs-on: ubuntu-latest - environment: ${{ inputs.environment }} - defaults: - run: - working-directory: ./layer - strategy: - fail-fast: false - matrix: - region: - [ - "af-south-1", - "eu-central-1", - "us-east-1", - "us-east-2", - "us-west-1", - "us-west-2", - "ap-east-1", - "ap-south-1", - "ap-northeast-1", - "ap-northeast-2", - "ap-southeast-1", - "ap-southeast-2", - "ca-central-1", - "eu-west-1", - "eu-west-2", - "eu-west-3", - "eu-south-1", - "eu-north-1", - "sa-east-1", - "ap-southeast-3", - "ap-northeast-3", - "me-south-1", - ] - steps: - - name: checkout - uses: actions/checkout@v3 - - name: Install poetry - run: pipx install poetry - - name: aws credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-region: ${{ matrix.region }} - role-to-assume: ${{ secrets.AWS_LAYERS_ROLE_ARN }} - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "16.12" - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: "3.9" - cache: "pip" - - name: Resolve and install project dependencies - # CDK spawns system python when compiling stack - # therefore it ignores both activated virtual env and cached interpreter by GH - run: | - poetry export --format requirements.txt --output requirements.txt - pip install -r requirements.txt - - name: install cdk and deps - run: | - npm install -g aws-cdk@2.29.0 - cdk --version - - name: install deps - run: poetry install - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: ${{ inputs.artefact-name }} - path: layer - - name: unzip artefact - run: unzip cdk.out.zip - - name: CDK Deploy Layer - run: cdk deploy --app cdk.out --context region=${{ matrix.region }} 'LayerStack' --require-approval never --verbose - - name: CDK Deploy Canary - run: cdk deploy --app cdk.out --context region=${{ matrix.region}} --parameters DeployStage="${{ inputs.stage }}" 'CanaryStack' --require-approval never --verbose diff --git a/.github/workflows/reusable_update_v2_layer_arn_docs.yml b/.github/workflows/reusable_update_v2_layer_arn_docs.yml index 857c8001bf9..ea13a63f64a 100644 --- a/.github/workflows/reusable_update_v2_layer_arn_docs.yml +++ b/.github/workflows/reusable_update_v2_layer_arn_docs.yml @@ -12,7 +12,7 @@ permissions: contents: write env: - BRANCH: v2 + BRANCH: develop jobs: publish_v2_layer_arn: diff --git a/.github/workflows/v2_on_push_docs.yml b/.github/workflows/v2_on_push_docs.yml deleted file mode 100644 index d70fedbc6c5..00000000000 --- a/.github/workflows/v2_on_push_docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Docs v2 - -on: - workflow_dispatch: -# push: -# branches: -# - v2 -# paths: -# - "docs/**" -# - "mkdocs.yml" -# - "examples/**" - -jobs: - changelog: - permissions: - contents: write - uses: ./.github/workflows/reusable_publish_changelog.yml - - release-docs: - needs: changelog - permissions: - contents: write - pages: write - uses: ./.github/workflows/reusable_publish_docs.yml - with: - version: v2 - alias: alpha -# Maintenance: Only necessary in repo migration -# - name: Create redirect from old docs -# run: | -# git checkout gh-pages -# test -f 404.html && echo "Redirect already set" && exit 0 -# git checkout develop -- 404.html -# git add 404.html -# git commit -m "chore: set docs redirect" --no-verify -# git push origin gh-pages -f diff --git a/.github/workflows/v2_rebuild_latest_docs.yml b/.github/workflows/v2_rebuild_latest_docs.yml deleted file mode 100644 index 6d833cc3fef..00000000000 --- a/.github/workflows/v2_rebuild_latest_docs.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: V2 Rebuild latest docs - -on: - workflow_dispatch: - -jobs: - release-docs: - permissions: - contents: write - pages: write - uses: ./.github/workflows/reusable_publish_docs.yml - with: - version: v2 - alias: alpha