-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Create SDK Snapshot | ||
|
||
on: | ||
pull_request: | ||
branches: ['master'] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: 🤘 Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
cache: 'npm' | ||
|
||
- name: 🔐 Authenticate with NPM | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
|
||
- name: 🧩 Install dependencies | ||
run: npm ci --ignore-scripts | ||
|
||
- name: 🖊️ Bump version | ||
run: npm run changeset:snapshot -- --pr $PR --sha $COMMIT_SHA | ||
env: | ||
PR: ${{ github.event.pull_request.number }} | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: 🛠️ Build SDK | ||
run: npm run build | ||
|
||
- name: 🚀 Publish snapshot | ||
run: npm run changeset -- publish --no-git-tag --snapshot --tag beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import applyReleasePlan from '@changesets/apply-release-plan'; | ||
import getReleasePlan from '@changesets/get-release-plan'; | ||
|
||
import { read } from '@changesets/config'; | ||
import { getPackages } from '@manypkg/get-packages'; | ||
|
||
import { parseArgs } from './common.mjs'; | ||
|
||
const main = async () => { | ||
const cwd = process.cwd(); | ||
const args = process.argv.slice(2); | ||
const params = parseArgs(args); | ||
|
||
const packages = await getPackages(cwd); | ||
const config = await read(cwd, packages); | ||
const releaseConfig = { | ||
...config, | ||
commit: false, | ||
}; | ||
|
||
const releasePlan = await getReleasePlan(cwd, undefined); | ||
const pullRequest = params['pr']; | ||
const commitSha = params['sha']; | ||
|
||
releasePlan.releases.map((r) => { | ||
r.newVersion = [ | ||
r.newVersion, | ||
'pr' + pullRequest, | ||
commitSha.substring(0, 7), | ||
].join('-'); | ||
}); | ||
await applyReleasePlan(releasePlan, packages, releaseConfig, true); | ||
}; | ||
|
||
main() | ||
.then(() => console.log('Snapshot version bump ✅')) | ||
.catch(console.error) | ||
.finally(() => process.exit(0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.