diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e2f9e5b..66a368b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,12 +5,36 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + jobs: - release: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - name: Release Please + id: release + uses: googleapis/release-please-action@v5.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + + publish: + needs: release-please + if: needs.release-please.outputs.release_created == 'true' runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@v7.0.1 + with: + ref: ${{ needs.release-please.outputs.tag_name }} - name: Setup Bun uses: oven-sh/setup-bun@v2.2.0 @@ -18,9 +42,19 @@ jobs: bun-version-file: package.json - name: Install - run: bun install + run: bun i + + - name: Build + run: bun run build + + - name: Inject Mozilla Cert Bundles + run: curl https://curl.se/ca/cacert.pem -o build/public-certs.pem + + - name: Zip Lambda + run: bun run package - - name: Semantic Release - uses: cycjimmy/semantic-release-action@v8.1.4 + - name: Upload Release Assets env: - GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.release-please.outputs.tag_name }} + run: gh release upload "$TAG" proxy-lambda.zip --clobber diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..e264113 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.4.4" +} diff --git a/.releaserc.yaml b/.releaserc.yaml deleted file mode 100644 index 75c3f26..0000000 --- a/.releaserc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -plugins: - - - "@semantic-release/commit-analyzer" - - preset: angular - releaseRules: - - breaking: true - release: major - - type: breaking - release: major - - type: docs - release: patch - - type: refactor - release: patch - - scope: no-release - release: false - - "@semantic-release/release-notes-generator" - - - "@semantic-release/github" - - assets: - - proxy-lambda.zip -branches: - - main diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..fa31cc0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "include-component-in-tag": false, + "changelog-sections": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "revert", "section": "Reverts" }, + { "type": "docs", "section": "Documentation" }, + { "type": "refactor", "section": "Code Refactoring" }, + { "type": "chore", "section": "Miscellaneous Chores", "hidden": true }, + { "type": "style", "section": "Styles", "hidden": true }, + { "type": "test", "section": "Tests", "hidden": true }, + { "type": "build", "section": "Build System", "hidden": true }, + { "type": "ci", "section": "Continuous Integration", "hidden": true } + ], + "packages": { + ".": {} + } +}