diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 53264b6..55960f6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,8 @@ updates: time: "12:00" day: "sunday" timezone: "America/Los_Angeles" + commit-message: + prefix: "chore" - package-ecosystem: "npm" directory: "/" open-pull-requests-limit: 5 @@ -16,6 +18,10 @@ updates: time: "12:00" day: "sunday" timezone: "America/Los_Angeles" + commit-message: + prefix: "fix" + prefix-development: "chore" + include: "scope" groups: dev-deps: dependency-type: "development" diff --git a/.github/release-configs/release-please-config.beta.json b/.github/release-configs/release-please-config.beta.json new file mode 100644 index 0000000..b6b40c6 --- /dev/null +++ b/.github/release-configs/release-please-config.beta.json @@ -0,0 +1,59 @@ +{ + "packages": { + ".": { + "release-type": "node", + "version-file": "package.json", + "changelog-path": "CHANGELOG.md", + "extra-files": ["README.md"], + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "refactor", + "section": "Code Refactoring" + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "test", + "section": "Tests", + "hidden": false + }, + { + "type": "build", + "section": "Build System", + "hidden": false + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": false + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": false + } + ], + "prerelease": true, + "prerelease-type": "beta" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "4d986f830d4087bd78c3f8cc1ace393325161da5" +} diff --git a/.github/release-configs/release-please-config.json b/.github/release-configs/release-please-config.json new file mode 100644 index 0000000..cc81f6f --- /dev/null +++ b/.github/release-configs/release-please-config.json @@ -0,0 +1,57 @@ +{ + "packages": { + ".": { + "release-type": "node", + "version-file": "package.json", + "changelog-path": "CHANGELOG.md", + "extra-files": ["README.md"], + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "refactor", + "section": "Code Refactoring" + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "test", + "section": "Tests", + "hidden": false + }, + { + "type": "build", + "section": "Build System", + "hidden": false + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": false + }, + { + "type": "chore", + "section": "Miscellaneous Chores", + "hidden": false + } + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "4d986f830d4087bd78c3f8cc1ace393325161da5" +} diff --git a/.github/release-configs/release-please-manifest.beta.json b/.github/release-configs/release-please-manifest.beta.json new file mode 100644 index 0000000..d42dbf8 --- /dev/null +++ b/.github/release-configs/release-please-manifest.beta.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.0-beta.0" +} diff --git a/.github/release-configs/release-please-manifest.json b/.github/release-configs/release-please-manifest.json new file mode 100644 index 0000000..895bf0e --- /dev/null +++ b/.github/release-configs/release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.0" +} diff --git a/.github/workflows/release-on-push.yml b/.github/workflows/release-on-push.yml new file mode 100644 index 0000000..6cb5d21 --- /dev/null +++ b/.github/workflows/release-on-push.yml @@ -0,0 +1,33 @@ +name: Release on Push + +# Automatically creates GitHub releases after release PRs are merged + +on: + push: + branches: + - main + - beta + # - alpha # Uncomment if you have an alpha channel + +jobs: + create-release: + runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - name: Checkout workflows repository + uses: actions/checkout@v4 + with: + repository: heroku/npm-release-workflows + token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + path: workflows-repo + ref: main + + - name: Create GitHub Release + uses: ./workflows-repo/.github/actions/release-on-push-create-release-public + with: + package-manager: yarn # npm | yarn | pnpm + branch_name: ${{ github.ref_name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d2a7776 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,99 @@ +name: Release + +# Public repo workflow using token-based checkout to access private npm-release-workflows + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Test release without publishing (creates PR but skips npm publish)' + type: boolean + default: false + required: false + +jobs: + validate: + runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip + steps: + - uses: actions/checkout@v4 + + - name: Checkout workflows repository + uses: actions/checkout@v4 + with: + repository: heroku/npm-release-workflows + token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + path: workflows-repo + ref: main + + - name: Validate and test + uses: ./workflows-repo/.github/actions/release-validate-public + with: + package-manager: yarn # npm | yarn | pnpm + lint_command: 'run lint' + test_command: 'run test' + + release-please-pr: + needs: validate + runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip + permissions: + contents: write + pull-requests: write + outputs: + release_created: ${{ steps.release-workflow.outputs.release_created }} + tag_name: ${{ steps.release-workflow.outputs.tag_name }} + pr_number: ${{ steps.release-workflow.outputs.pr_number }} + config_file: ${{ steps.release-workflow.outputs.config_file }} + manifest_file: ${{ steps.release-workflow.outputs.manifest_file }} + npm_tag: ${{ steps.release-workflow.outputs.npm_tag }} + package_name: ${{ steps.release-workflow.outputs.package_name }} + no_release_needed: ${{ steps.release-workflow.outputs.no_release_needed }} + pr_already_exists: ${{ steps.release-workflow.outputs.pr_already_exists }} + steps: + - uses: actions/checkout@v4 + + - name: Checkout workflows repository + uses: actions/checkout@v4 + with: + repository: heroku/npm-release-workflows + token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + path: workflows-repo + ref: main + + - name: Create release PR + id: release-workflow + uses: ./workflows-repo/.github/actions/release-please-pr-public + with: + package-manager: yarn # npm | yarn | pnpm + branch_name: ${{ github.ref_name }} + dry_run: ${{ inputs.dry_run }} + + publish: + needs: release-please-pr + if: needs.release-please-pr.result == 'success' && (needs.release-please-pr.outputs.pr_number != '' || needs.release-please-pr.outputs.pr_already_exists == 'true') + runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip + permissions: + contents: write + pull-requests: write + id-token: write + steps: + - uses: actions/checkout@v4 + + - name: Checkout workflows repository + uses: actions/checkout@v4 + with: + repository: heroku/npm-release-workflows + token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + path: workflows-repo + ref: main + + - name: Publish to npm + uses: ./workflows-repo/.github/actions/release-publish-public + with: + package-manager: yarn # npm | yarn | pnpm + workflows_token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + build_command: 'run build' + dry_run: ${{ inputs.dry_run }} + npm_tag: ${{ needs.release-please-pr.outputs.npm_tag }} + package_name: ${{ needs.release-please-pr.outputs.package_name }} + pr_number: ${{ needs.release-please-pr.outputs.pr_number }} + branch_name: ${{ github.ref_name }} diff --git a/.github/workflows/update-release-configs.yml b/.github/workflows/update-release-configs.yml new file mode 100644 index 0000000..4b134d9 --- /dev/null +++ b/.github/workflows/update-release-configs.yml @@ -0,0 +1,26 @@ +name: Update Release Configs + +# Generates release-please config files from release-channels.yml + +on: + workflow_dispatch: + +jobs: + update-configs: + runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - name: Checkout workflows repository + uses: actions/checkout@v4 + with: + repository: heroku/npm-release-workflows + token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }} + path: workflows-repo + ref: main + + - name: Update release configs + uses: ./workflows-repo/.github/actions/update-release-configs-job-public diff --git a/release-channels.yml b/release-channels.yml new file mode 100644 index 0000000..92df8f0 --- /dev/null +++ b/release-channels.yml @@ -0,0 +1,19 @@ +# Release channels configuration - generates release-please config files + +channels: + main: + branch: main + prerelease: false + npm-tag: latest + + beta: + branch: beta + prerelease: true + prerelease-type: beta + npm-tag: beta + + # alpha: + # branch: alpha + # prerelease: true + # prerelease-type: alpha + # npm-tag: alpha