diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..45a4a26 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,44 @@ + + +## Summary + + +## Type of Change +### Breaking Changes (major semver update) +- [ ] Add a `!` after your change type to denote a change that breaks current behavior + +### Feature Additions (minor semver update) +- [ ] **feat**: Introduces a new feature to the codebase + +### Patch Updates (patch semver update) +- [ ] **fix**: Bug fix +- [ ] **deps**: Dependency upgrade +- [ ] **revert**: Revert a previous commit +- [ ] **chore**: Change that does not affect production code +- [ ] **refactor**: Refactoring existing code without changing behavior +- [ ] **test**: Add/update/remove tests + +## Testing +**Notes**: + + +**Steps**: +1. Replace this text with a list of steps used to validate changes or type 'Passing CI suffices'. +2. ... + +## Screenshots (if applicable) + +## Related Issues +GitHub issue: #[GitHub issue number] +GUS work item: [WI number](WI link) 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..0d34ec1 --- /dev/null +++ b/.github/release-configs/release-please-config.beta.json @@ -0,0 +1,16 @@ +{ + "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, + "prerelease": true, + "prerelease-type": "beta" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "ac230bea5ae1aab5677303f99996d04d5c4c1b1c" +} diff --git a/.github/release-configs/release-please-config.json b/.github/release-configs/release-please-config.json new file mode 100644 index 0000000..862c456 --- /dev/null +++ b/.github/release-configs/release-please-config.json @@ -0,0 +1,14 @@ +{ + "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 + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bootstrap-sha": "ac230bea5ae1aab5677303f99996d04d5c4c1b1c" +} 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..d438033 --- /dev/null +++ b/.github/release-configs/release-please-manifest.beta.json @@ -0,0 +1,3 @@ +{ + ".": "3.1.1-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..b4b8d0f --- /dev/null +++ b/.github/release-configs/release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.1.1" +} diff --git a/.github/workflows/release-on-push.yml b/.github/workflows/release-on-push.yml new file mode 100644 index 0000000..b602eda --- /dev/null +++ b/.github/workflows/release-on-push.yml @@ -0,0 +1,44 @@ +name: Release on Push + +# Automatically creates GitHub releases after release PRs are merged +# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY + +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: + # owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows) + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - uses: actions/checkout@v6 + + - name: Checkout workflows repository + uses: actions/checkout@v6 + with: + repository: heroku/npm-release-workflows + token: ${{ steps.app-token.outputs.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 }} + token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b69692d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,128 @@ +name: Release + +# Public repo workflow using GitHub App token to access private npm-release-workflows +# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY + +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: + # owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows) + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - uses: actions/checkout@v6 + + - name: Checkout workflows repository + uses: actions/checkout@v6 + with: + repository: heroku/npm-release-workflows + token: ${{ steps.app-token.outputs.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: '' # No lint script found + 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: + # owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows) + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - uses: actions/checkout@v6 + + - name: Checkout workflows repository + uses: actions/checkout@v6 + with: + repository: heroku/npm-release-workflows + token: ${{ steps.app-token.outputs.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 }} + token: ${{ steps.app-token.outputs.token }} + + 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: + # owner scopes the token to the org installation so it can access other repos (e.g. private npm-release-workflows) + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - uses: actions/checkout@v6 + + - name: Checkout workflows repository + uses: actions/checkout@v6 + with: + repository: heroku/npm-release-workflows + token: ${{ steps.app-token.outputs.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: ${{ steps.app-token.outputs.token }} + build_command: '' # No build script found + 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..bda18d7 --- /dev/null +++ b/.github/workflows/update-release-configs.yml @@ -0,0 +1,34 @@ +name: Update Release Configs + +# Generates release-please config files from release-channels.yml +# Uses vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID and secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY + +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: + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.DEV_TOOLS_RELEASE_WORKFLOW_APP_ID }} + private-key: ${{ secrets.DEV_TOOLS_RELEASE_WORKFLOW_APP_PRIVATE_KEY }} + + - uses: actions/checkout@v6 + + - name: Checkout workflows repository + uses: actions/checkout@v6 + with: + repository: heroku/npm-release-workflows + token: ${{ steps.app-token.outputs.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