Skip to content

Commit e4a52a6

Browse files
adding workflows for onboarding to the npm-release-workflows shared release (#143)
1 parent fa25b6a commit e4a52a6

File tree

8 files changed

+157
-70
lines changed

8 files changed

+157
-70
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "node",
5+
"version-file": "package.json",
6+
"changelog-path": "CHANGELOG.md",
7+
"extra-files": ["README.md"],
8+
"bump-minor-pre-major": true,
9+
"bump-patch-for-minor-pre-major": true,
10+
"changelog-sections": [
11+
{
12+
"type": "feat",
13+
"section": "Features"
14+
},
15+
{
16+
"type": "fix",
17+
"section": "Bug Fixes"
18+
},
19+
{
20+
"type": "perf",
21+
"section": "Performance Improvements"
22+
},
23+
{
24+
"type": "refactor",
25+
"section": "Code Refactoring"
26+
},
27+
{
28+
"type": "docs",
29+
"section": "Documentation",
30+
"hidden": false
31+
},
32+
{
33+
"type": "test",
34+
"section": "Tests",
35+
"hidden": false
36+
},
37+
{
38+
"type": "build",
39+
"section": "Build System",
40+
"hidden": false
41+
},
42+
{
43+
"type": "ci",
44+
"section": "Continuous Integration",
45+
"hidden": false
46+
},
47+
{
48+
"type": "chore",
49+
"section": "Miscellaneous Chores",
50+
"hidden": false
51+
}
52+
],
53+
"prerelease": true,
54+
"prerelease-type": "beta"
55+
}
56+
},
57+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
58+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "node",
5+
"version-file": "package.json",
6+
"changelog-path": "CHANGELOG.md",
7+
"extra-files": ["README.md"],
8+
"bump-minor-pre-major": true,
9+
"bump-patch-for-minor-pre-major": true,
10+
"changelog-sections": [
11+
{
12+
"type": "feat",
13+
"section": "Features"
14+
},
15+
{
16+
"type": "fix",
17+
"section": "Bug Fixes"
18+
},
19+
{
20+
"type": "perf",
21+
"section": "Performance Improvements"
22+
},
23+
{
24+
"type": "refactor",
25+
"section": "Code Refactoring"
26+
},
27+
{
28+
"type": "docs",
29+
"section": "Documentation",
30+
"hidden": false
31+
},
32+
{
33+
"type": "test",
34+
"section": "Tests",
35+
"hidden": false
36+
},
37+
{
38+
"type": "build",
39+
"section": "Build System",
40+
"hidden": false
41+
},
42+
{
43+
"type": "ci",
44+
"section": "Continuous Integration",
45+
"hidden": false
46+
},
47+
{
48+
"type": "chore",
49+
"section": "Miscellaneous Chores",
50+
"hidden": false
51+
}
52+
]
53+
}
54+
},
55+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
56+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.0.1-beta.0"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.0.1"
3+
}
Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
name: Release on Push
22

3-
# This workflow automatically creates GitHub releases after release PRs are merged
4-
# It triggers on push to branches defined in your release-channels.yml
5-
# This workflow is for PUBLIC repositories that need to use workflows from a PRIVATE repository
6-
# It uses token-based checkout to access the private npm-release-workflows repository
7-
#
8-
# SETUP INSTRUCTIONS:
9-
# 1. Ensure WORKFLOWS_ACCESS_GITHUB_TOKEN secret is configured (see docs/credentials.md)
10-
# 2. Replace 'heroku' with your GitHub organization name
11-
# 3. Replace 'npm-release-workflows' with the actual repository name if different
12-
# 4. Update the branches list to match your release-channels.yml branch names
13-
# 5. Copy this file to .github/workflows/release-on-push.yml in your project
14-
#
15-
# IMPORTANT: The branches in the push trigger MUST match the branch names
16-
# defined in your release-channels.yml file
3+
# Automatically creates GitHub releases after release PRs are merged
174

185
on:
196
push:
207
branches:
21-
# Add all branches that are defined in your release-channels.yml
22-
# Common examples:
23-
- main # Stable releases
24-
- beta # Beta/prerelease channel
25-
# - alpha # Uncomment if you have an alpha channel
26-
# Add any other branches defined in your release-channels.yml
8+
- main
9+
- beta
10+
# - alpha # Uncomment if you have an alpha channel
2711

2812
jobs:
2913
create-release:
30-
runs-on: pub-hk-ubuntu-24.04-ip
14+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
3115
permissions:
3216
contents: write
3317
pull-requests: write
@@ -45,8 +29,5 @@ jobs:
4529
- name: Create GitHub Release
4630
uses: ./workflows-repo/.github/actions/release-on-push-create-release-public
4731
with:
48-
# Update package-manager to match your project (npm, yarn, or pnpm)
49-
# Used for installing dependencies when creating releases
50-
package-manager: yarn
32+
package-manager: yarn # npm | yarn | pnpm
5133
branch_name: ${{ github.ref_name }}
52-

.github/workflows/release.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
name: Release
22

3-
# This workflow is for PUBLIC repositories that need to use workflows from a PRIVATE repository
4-
# It uses token-based checkout to access the private npm-release-workflows repository
5-
#
6-
# SETUP INSTRUCTIONS:
7-
# 1. Create a Personal Access Token (PAT) or GitHub App token with 'repo' scope
8-
# - See documentation for token creation instructions (docs/credentials.md)
9-
# 2. Add the token as a secret named 'WORKFLOWS_ACCESS_GITHUB_TOKEN' in your repository
10-
# 3. Replace 'heroku' with your GitHub organization name
11-
# 4. Replace 'npm-release-workflows' with the actual repository name if different
12-
# 5. Adjust the hardcoded values in the workflow (package_manager, test_command, lint_command, build_command)
13-
# based on your project's needs - these are hardcoded in the workflow, not passed as inputs
14-
# 6. Copy this file to .github/workflows/release.yml in your project
3+
# Public repo workflow using token-based checkout to access private npm-release-workflows
154

165
on:
176
workflow_dispatch:
187
inputs:
19-
# DRY RUN MODE
20-
# Set to true to test the release process without actually publishing to npm
21-
# Useful for validating workflow changes or testing version bumps
228
dry_run:
239
description: 'Test release without publishing (creates PR but skips npm publish)'
2410
type: boolean
@@ -27,7 +13,7 @@ on:
2713

2814
jobs:
2915
validate:
30-
runs-on: pub-hk-ubuntu-24.04-ip
16+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
3117
steps:
3218
- uses: actions/checkout@v4
3319

@@ -42,14 +28,13 @@ jobs:
4228
- name: Validate and test
4329
uses: ./workflows-repo/.github/actions/release-validate-public
4430
with:
45-
# Update these values to match your project:
46-
package-manager: yarn # Options: npm, yarn, or pnpm (must match your project's package manager)
47-
lint_command: 'run lint' # Set to '' to skip if no lint script exists
48-
test_command: 'test' # Set to '' to skip if no test script exists
31+
package-manager: yarn # npm | yarn | pnpm
32+
lint_command: 'run lint'
33+
test_command: 'run test'
4934

5035
release-please-pr:
5136
needs: validate
52-
runs-on: pub-hk-ubuntu-24.04-ip
37+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
5338
permissions:
5439
contents: write
5540
pull-requests: write
@@ -78,15 +63,14 @@ jobs:
7863
id: release-workflow
7964
uses: ./workflows-repo/.github/actions/release-please-pr-public
8065
with:
81-
# Update package-manager to match your project (npm, yarn, or pnpm)
82-
package-manager: yarn # Must match your project's package manager
66+
package-manager: yarn # npm | yarn | pnpm
8367
branch_name: ${{ github.ref_name }}
8468
dry_run: ${{ inputs.dry_run }}
8569

8670
publish:
8771
needs: release-please-pr
8872
if: needs.release-please-pr.result == 'success' && (needs.release-please-pr.outputs.pr_number != '' || needs.release-please-pr.outputs.pr_already_exists == 'true')
89-
runs-on: pub-hk-ubuntu-24.04-ip
73+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
9074
permissions:
9175
contents: write
9276
pull-requests: write
@@ -105,10 +89,9 @@ jobs:
10589
- name: Publish to npm
10690
uses: ./workflows-repo/.github/actions/release-publish-public
10791
with:
108-
# Update these values to match your project:
109-
package-manager: yarn # Options: npm, yarn, or pnpm (used for installing dependencies and building; publishing always uses pnpm)
92+
package-manager: yarn # npm | yarn | pnpm
11093
workflows_token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
111-
build_command: 'run build' # Set to '' to skip if no build script exists
94+
build_command: 'run build'
11295
dry_run: ${{ inputs.dry_run }}
11396
npm_tag: ${{ needs.release-please-pr.outputs.npm_tag }}
11497
package_name: ${{ needs.release-please-pr.outputs.package_name }}

.github/workflows/update-release-configs.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
name: Update Release Configs
22

3-
# This workflow generates release-please config files from your release-channels.yml
4-
# Run this whenever you modify release-channels.yml to regenerate the config files
5-
# This workflow is for PUBLIC repositories that need to use workflows from a PRIVATE repository
6-
# It uses token-based checkout to access the private npm-release-workflows repository
7-
#
8-
# SETUP INSTRUCTIONS:
9-
# 1. Ensure WORKFLOWS_ACCESS_GITHUB_TOKEN secret is configured (see docs/credentials.md)
10-
# 2. Replace 'heroku' with your GitHub organization name
11-
# 3. Replace 'npm-release-workflows' with the actual repository name if different
12-
# 4. Copy this file to .github/workflows/update-release-configs.yml in your project
13-
#
14-
# USAGE:
15-
# - Edit release-channels.yml in your project
16-
# - Go to Actions → "Update Release Configs" → "Run workflow"
17-
# - A PR will be created if the generated configs differ from committed versions
18-
# - Review and merge the PR to commit both release-channels.yml and generated configs
3+
# Generates release-please config files from release-channels.yml
194

205
on:
216
workflow_dispatch:
22-
# No inputs needed - this workflow reads from release-channels.yml
237

248
jobs:
259
update-configs:
26-
runs-on: pub-hk-ubuntu-24.04-ip
10+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
2711
permissions:
2812
contents: write
2913
pull-requests: write

release-channels.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Release channels configuration - generates release-please config files
2+
3+
channels:
4+
main:
5+
branch: main
6+
prerelease: false
7+
npm-tag: latest
8+
9+
beta:
10+
branch: beta
11+
prerelease: true
12+
prerelease-type: beta
13+
npm-tag: beta
14+
15+
# alpha:
16+
# branch: alpha
17+
# prerelease: true
18+
# prerelease-type: alpha
19+
# npm-tag: alpha

0 commit comments

Comments
 (0)