diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml deleted file mode 100644 index 7236c5d9..00000000 --- a/.github/workflows/changelog.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Changelog - -on: - push: - tags: - - "v*" - workflow_dispatch: - inputs: - version: - description: "Version tag to generate changelog for (e.g. v1.0.0)" - required: true - type: string - -permissions: - contents: write - -jobs: - changelog: - name: Generate Changelog - runs-on: ubuntu-latest - env: - VERSION_TAG: ${{ inputs.version || github.ref_name }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate changelog - uses: orhun/git-cliff-action@v4 - id: git-cliff - with: - config: cliff.toml - args: --verbose --tag ${{ env.VERSION_TAG }} - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - name: Commit changelog - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add CHANGELOG.md - git commit -m "chore: update changelog for ${{ env.VERSION_TAG }}" || true - git push origin HEAD:main - - - name: Create/update GitHub release body - uses: orhun/git-cliff-action@v4 - with: - config: cliff.toml - args: --verbose --latest --strip header - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REPO: ${{ github.repository }} diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..24f6d563 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,74 @@ +name: Release-plz + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + release-plz-pr: + name: Release-plz PR + # Don't run on forks. + if: github.repository == 'aws/aws-lambda-web-adapter' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - name: Generate a GitHub App token + uses: actions/create-github-app-token@v3 + id: app-token + with: + app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} + private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + token: ${{ steps.app-token.outputs.token }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz (release-pr) + uses: release-plz/action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + + release-plz-release: + name: Release-plz release + if: github.repository == 'aws/aws-lambda-web-adapter' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + id-token: write # crates.io trusted publishing (OIDC) + steps: + - name: Generate a GitHub App token + uses: actions/create-github-app-token@v3 + id: app-token + with: + app-id: ${{ secrets.RELEASE_PLZ_APP_ID }} + private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }} + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + token: ${{ steps.app-token.outputs.token }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz (release) + uses: release-plz/action@v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 00000000..7f6a4bdc --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,20 @@ +[workspace] +# Reuse the existing git-cliff config so the changelog keeps its current style. +changelog_config = "cliff.toml" + +# Match the existing tag scheme (v1.0.1, ...) so version detection works and the +# tags stay compatible with release.yaml / the SAM templates. +git_tag_name = "v{{ version }}" +git_tag_enable = true + +# Create the GitHub Release as a full PUBLISHED release (not a draft), so that +# release.yaml's `on: release: types: [released]` trigger fires. +git_release_enable = true +git_release_draft = false + +# Only cut a release when the Release PR is merged, not on every push to `main`. +release_always = false + +# Publish lambda_web_adapter to crates.io. +# Auth is provided by crates.io trusted publishing (OIDC) in release-plz.yml. +publish = true