| name: Release V3 |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
|
|
| env: |
| RELEASE_COMMIT: ${{ github.sha }} |
| RELEASE_TAG_VERSION: ${{ inputs.version_to_publish }} |
|
|
| on: |
| workflow_dispatch: |
| inputs: |
| version_to_publish: |
| description: "Version to be released in PyPi, Docs, and Lambda Layer, e.g. v3.0.0, v3.0.0a0 (pre-release)" |
| default: v3.0.0 |
| required: true |
| skip_pypi: |
| description: "Skip publishing to PyPi as it can't publish more than once. Useful for semi-failed releases" |
| default: false |
| type: boolean |
| required: false |
| skip_code_quality: |
| description: "Skip tests, linting, and baseline. Only use if release fail for reasons beyond our control and you need a quick release." |
| default: false |
| type: boolean |
| required: false |
| pre_release: |
| description: "Publishes documentation using a pre-release tag (v3.0.0a0). You are still responsible for passing a pre-release version tag to the workflow." |
| default: false |
| type: boolean |
| required: false |
|
|
| permissions: |
| contents: read |
|
|
| jobs: |
|
|
| |
| |
| |
| |
| seal: |
| runs-on: ubuntu-latest |
| permissions: |
| contents: read |
| outputs: |
| integrity_hash: ${{ steps.seal_source_code.outputs.integrity_hash }} |
| artifact_name: ${{ steps.seal_source_code.outputs.artifact_name }} |
| RELEASE_VERSION: ${{ steps.release_version.outputs.RELEASE_VERSION }} |
| steps: |
| - name: Export release version |
| id: release_version |
| |
| run: | |
| RELEASE_VERSION="${RELEASE_TAG_VERSION:1}" |
| echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT" |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| |
| - name: Install poetry |
| run: | |
| pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 # v1.5.0 |
| pipx inject poetry git+https://github.com/monim67/poetry-bumpversion@315fe3324a699fa12ec20e202eb7375d4327d1c4 # v0.3.1 |
| |
| - name: Bump package version |
| id: versioning |
| run: poetry version "${RELEASE_VERSION}" |
| env: |
| RELEASE_VERSION: ${{ steps.release_version.outputs.RELEASE_VERSION}} |
|
|
| - name: Seal and upload |
| id: seal_source_code |
| uses: ./.github/actions/seal |
| with: |
| artifact_name_prefix: "source" |
|
|
| |
| |
| |
| |
| |
| |
| quality_check: |
| needs: seal |
| runs-on: ubuntu-latest |
| permissions: |
| contents: read |
| steps: |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
| artifact_name: ${{ needs.seal.outputs.artifact_name }} |
|
|
| - name: Debug cache restore |
| run: cat pyproject.toml |
|
|
| - name: Install poetry |
| run: pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 |
| - name: Set up Python |
| uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b |
| with: |
| python-version: "3.12" |
| cache: "poetry" |
| - name: Install dependencies |
| run: make dev |
| - name: Run all tests, linting and baselines |
| run: make pr |
|
|
| |
| |
| |
| |
| |
| build: |
| runs-on: ubuntu-latest |
| needs: [quality_check, seal] |
| permissions: |
| contents: read |
| outputs: |
| integrity_hash: ${{ steps.seal_build.outputs.integrity_hash }} |
| artifact_name: ${{ steps.seal_build.outputs.artifact_name }} |
| attestation_hashes: ${{ steps.encoded_hash.outputs.attestation_hashes }} |
| steps: |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
| artifact_name: ${{ needs.seal.outputs.artifact_name }} |
|
|
| - name: Install poetry |
| run: pipx install git+https://github.com/python-poetry/poetry@68b88e5390720a3dd84f02940ec5200bfce39ac6 |
| - name: Set up Python |
| uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b |
| with: |
| python-version: "3.12" |
| cache: "poetry" |
|
|
| - name: Build python package and wheel |
| run: poetry build |
|
|
| - name: Seal and upload |
| id: seal_build |
| uses: ./.github/actions/seal |
| with: |
| artifact_name_prefix: "build" |
| files: "dist/" |
|
|
| |
| |
| - name: Create attestation encoded hash for provenance |
| id: encoded_hash |
| working-directory: dist |
| run: echo "attestation_hashes=$(sha256sum ./* | base64 -w0)" >> "$GITHUB_OUTPUT" |
|
|
| |
| |
| |
| |
| |
| |
| provenance: |
| needs: [seal, build] |
| permissions: |
| contents: write |
| actions: read |
| id-token: write |
| |
| |
| |
| uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0 |
| with: |
| base64-subjects: ${{ needs.build.outputs.attestation_hashes }} |
| upload-assets: false |
|
|
| |
| |
| |
| |
| release: |
| needs: [build, seal, provenance] |
| environment: release |
| runs-on: ubuntu-latest |
| permissions: |
| id-token: write |
| env: |
| RELEASE_VERSION: ${{ needs.seal.outputs.RELEASE_VERSION }} |
| steps: |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.build.outputs.integrity_hash }} |
| artifact_name: ${{ needs.build.outputs.artifact_name }} |
|
|
| - name: Upload to PyPi prod |
| if: ${{ !inputs.skip_pypi }} |
| uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc |
|
|
| |
| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| create_tag: |
| needs: [release, seal, provenance] |
| runs-on: ubuntu-latest |
| permissions: |
| contents: write |
| steps: |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
| artifact_name: ${{ needs.seal.outputs.artifact_name }} |
|
|
| - id: setup-git |
| name: Git client setup and refresh tip |
| run: | |
| git config user.name "Powertools for AWS Lambda (Python) bot" |
| git config user.email "151832416+aws-powertools-bot@users.noreply.github.com" |
| git config remote.origin.url >&- |
| |
| - name: Create Git Tag |
| run: | |
| git add pyproject.toml aws_lambda_powertools/shared/version.py |
| git commit -m "chore: version bump" |
| git tag -a v"${RELEASE_VERSION}" -m "release_version: v${RELEASE_VERSION}" |
| git push origin v"${RELEASE_VERSION}" |
| env: |
| RELEASE_VERSION: ${{ needs.seal.outputs.RELEASE_VERSION }} |
|
|
| - name: Upload provenance |
| id: upload-provenance |
| uses: ./.github/actions/upload-release-provenance |
| with: |
| release_version: ${{ needs.seal.outputs.RELEASE_VERSION }} |
| provenance_name: ${{needs.provenance.outputs.provenance-name}} |
| github_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
| |
| |
| bump_version: |
| needs: [release, seal] |
| permissions: |
| contents: write |
| pull-requests: write |
| runs-on: ubuntu-latest |
| steps: |
| |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
|
|
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
| artifact_name: ${{ needs.seal.outputs.artifact_name }} |
|
|
| - name: Create PR |
| id: create-pr |
| uses: ./.github/actions/create-pr |
| with: |
| files: "pyproject.toml aws_lambda_powertools/shared/version.py" |
| temp_branch_prefix: "ci-bump" |
| pull_request_title: "chore(ci): bump version to ${{ needs.seal.outputs.RELEASE_VERSION }}" |
| github_token: ${{ secrets.GITHUB_TOKEN }} |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| publish_layer: |
| needs: [seal, release, create_tag] |
| secrets: inherit |
| permissions: |
| id-token: write |
| contents: write |
| pages: write |
| pull-requests: write |
| uses: ./.github/workflows/publish_v3_layer.yml |
| with: |
| latest_published_version: ${{ needs.seal.outputs.RELEASE_VERSION }} |
| pre_release: ${{ inputs.pre_release }} |
| source_code_artifact_name: ${{ needs.seal.outputs.artifact_name }} |
| source_code_integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
|
|
| post_release: |
| needs: [seal, release, publish_layer] |
| permissions: |
| contents: read |
| issues: write |
| discussions: write |
| pull-requests: write |
| runs-on: ubuntu-latest |
| env: |
| RELEASE_VERSION: ${{ needs.seal.outputs.RELEASE_VERSION }} |
| steps: |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 |
| with: |
| ref: ${{ env.RELEASE_COMMIT }} |
| - name: Restore sealed source code |
| uses: ./.github/actions/seal-restore |
| with: |
| integrity_hash: ${{ needs.seal.outputs.integrity_hash }} |
| artifact_name: ${{ needs.seal.outputs.artifact_name }} |
| - name: Close issues related to this release |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea |
| with: |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| script: | |
| const post_release = require('.github/scripts/post_release.js') |
| await post_release({github, context, core}) |
| |