Skip to content

Commit ab8aefa

Browse files
chore: onboard shared workflows (#57)
Co-authored-by: Eric Black <eblack@salesforce.com>
1 parent b1dd5e3 commit ab8aefa

9 files changed

Lines changed: 305 additions & 0 deletions

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updates:
88
time: "12:00"
99
day: "sunday"
1010
timezone: "America/Los_Angeles"
11+
commit-message:
12+
prefix: "chore"
1113
- package-ecosystem: "npm"
1214
directory: "/"
1315
open-pull-requests-limit: 5
@@ -16,6 +18,10 @@ updates:
1618
time: "12:00"
1719
day: "sunday"
1820
timezone: "America/Los_Angeles"
21+
commit-message:
22+
prefix: "fix"
23+
prefix-development: "chore"
24+
include: "scope"
1925
groups:
2026
dev-deps:
2127
dependency-type: "development"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
"bootstrap-sha": "4d986f830d4087bd78c3f8cc1ace393325161da5"
59+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
"bootstrap-sha": "4d986f830d4087bd78c3f8cc1ace393325161da5"
57+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "2.0.0-beta.0"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "2.0.0"
3+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release on Push
2+
3+
# Automatically creates GitHub releases after release PRs are merged
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- beta
10+
# - alpha # Uncomment if you have an alpha channel
11+
12+
jobs:
13+
create-release:
14+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Checkout workflows repository
22+
uses: actions/checkout@v4
23+
with:
24+
repository: heroku/npm-release-workflows
25+
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
26+
path: workflows-repo
27+
ref: main
28+
29+
- name: Create GitHub Release
30+
uses: ./workflows-repo/.github/actions/release-on-push-create-release-public
31+
with:
32+
package-manager: yarn # npm | yarn | pnpm
33+
branch_name: ${{ github.ref_name }}

.github/workflows/release.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Release
2+
3+
# Public repo workflow using token-based checkout to access private npm-release-workflows
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
dry_run:
9+
description: 'Test release without publishing (creates PR but skips npm publish)'
10+
type: boolean
11+
default: false
12+
required: false
13+
14+
jobs:
15+
validate:
16+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Checkout workflows repository
21+
uses: actions/checkout@v4
22+
with:
23+
repository: heroku/npm-release-workflows
24+
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
25+
path: workflows-repo
26+
ref: main
27+
28+
- name: Validate and test
29+
uses: ./workflows-repo/.github/actions/release-validate-public
30+
with:
31+
package-manager: yarn # npm | yarn | pnpm
32+
lint_command: 'run lint'
33+
test_command: 'run test'
34+
35+
release-please-pr:
36+
needs: validate
37+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
38+
permissions:
39+
contents: write
40+
pull-requests: write
41+
outputs:
42+
release_created: ${{ steps.release-workflow.outputs.release_created }}
43+
tag_name: ${{ steps.release-workflow.outputs.tag_name }}
44+
pr_number: ${{ steps.release-workflow.outputs.pr_number }}
45+
config_file: ${{ steps.release-workflow.outputs.config_file }}
46+
manifest_file: ${{ steps.release-workflow.outputs.manifest_file }}
47+
npm_tag: ${{ steps.release-workflow.outputs.npm_tag }}
48+
package_name: ${{ steps.release-workflow.outputs.package_name }}
49+
no_release_needed: ${{ steps.release-workflow.outputs.no_release_needed }}
50+
pr_already_exists: ${{ steps.release-workflow.outputs.pr_already_exists }}
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Checkout workflows repository
55+
uses: actions/checkout@v4
56+
with:
57+
repository: heroku/npm-release-workflows
58+
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
59+
path: workflows-repo
60+
ref: main
61+
62+
- name: Create release PR
63+
id: release-workflow
64+
uses: ./workflows-repo/.github/actions/release-please-pr-public
65+
with:
66+
package-manager: yarn # npm | yarn | pnpm
67+
branch_name: ${{ github.ref_name }}
68+
dry_run: ${{ inputs.dry_run }}
69+
70+
publish:
71+
needs: release-please-pr
72+
if: needs.release-please-pr.result == 'success' && (needs.release-please-pr.outputs.pr_number != '' || needs.release-please-pr.outputs.pr_already_exists == 'true')
73+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
74+
permissions:
75+
contents: write
76+
pull-requests: write
77+
id-token: write
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Checkout workflows repository
82+
uses: actions/checkout@v4
83+
with:
84+
repository: heroku/npm-release-workflows
85+
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
86+
path: workflows-repo
87+
ref: main
88+
89+
- name: Publish to npm
90+
uses: ./workflows-repo/.github/actions/release-publish-public
91+
with:
92+
package-manager: yarn # npm | yarn | pnpm
93+
workflows_token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
94+
build_command: 'run build'
95+
dry_run: ${{ inputs.dry_run }}
96+
npm_tag: ${{ needs.release-please-pr.outputs.npm_tag }}
97+
package_name: ${{ needs.release-please-pr.outputs.package_name }}
98+
pr_number: ${{ needs.release-please-pr.outputs.pr_number }}
99+
branch_name: ${{ github.ref_name }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Update Release Configs
2+
3+
# Generates release-please config files from release-channels.yml
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-configs:
10+
runs-on: pub-hk-ubuntu-24.04-ip # Options: ubuntu-latest | sfdc-hk-ubuntu-latest | pub-hk-ubuntu-24.04-ip
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Checkout workflows repository
18+
uses: actions/checkout@v4
19+
with:
20+
repository: heroku/npm-release-workflows
21+
token: ${{ secrets.WORKFLOWS_ACCESS_GITHUB_TOKEN }}
22+
path: workflows-repo
23+
ref: main
24+
25+
- name: Update release configs
26+
uses: ./workflows-repo/.github/actions/update-release-configs-job-public

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)