Skip to content

Commit

Permalink
chore: setup-changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbas21 committed Oct 16, 2024
1 parent 299a14d commit fb28d4a
Show file tree
Hide file tree
Showing 5 changed files with 603 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@forgerock/javascript-sdk", "@forgerock/ping-protect"]],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
100 changes: 100 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: ForgeRock Pull Request CI
on:
push:
branches:
- master
- develop
env:
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_DISTRIBUTED_EXECUTION: true
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
pr:
permissions:
contents: write # to create release (changesets/action)
issues: write # to post issue comments (changesets/action)
pull-requests: write # to create pull request (changesets/action)
id-token: write # give id token write for provenance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
id: cache
with:
node-version: '20.10.0'
cache: 'pnpm'

- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true

- run: git config --global commit.gpgsign true
- run: git config --global user.email "${{ steps.import-gpg.outputs.email }}"
- run: git config --global user.name "github-actions[bot]"

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > .npmrc

- run: pnpm install --frozen-lockfile

# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci" --verbose

- run: pnpm exec playwright install

- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: master

- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- run: pnpm exec nx-cloud record -- nx format:check --verbose
- run: pnpm exec nx affected -t build lint test e2e-ci --verbose

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
./dist/.playwright/**
./dist/**
retention-days: 30

- name: publish
uses: changesets/action@v1
id: changesets
with:
publish: pnpm release
title: Release PR
branch: main
setupGitUser: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: rebase develop with main on publish
if: ${{ steps.changesets.outputs.published == 'true' }}
run: |
git checkout master
git fetch --all
git pull origin master
git checkout develop
git restore .
git rebase master
git push -f
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 16 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "@forgerock/javascript-sdk",
"description": "ForgeRock JavaScript SDK",
"engines": { "node": "^20 || ^18", "npm": ">= 7.0.0" },
"engines": {
"node": "^20 || ^18",
"npm": ">= 7.0.0"
},
"private": true,
"scripts": {
"build": "nx affected --target=build",
"changeset": "pnpm changeset",
"clean": "shx rm -rf ./{coverage,dist,docs,node_modules,tmp}/ ./{packages,e2e}/*/dist && git clean -fX -e \"!.env*,nx-cloud.env\"",
"commit": "git cz",
"docs": "nx affected --target=typedoc",
Expand Down Expand Up @@ -109,11 +113,19 @@
},
"workspaces": ["e2e/*", "packages/*"],
"config": {
"commitizen": { "path": "./node_modules/cz-conventional-changelog" }
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"nx": {
"includedScripts": []
},
"nx": { "includedScripts": [] },
"packageManager": "[email protected]+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e",
"dependencies": { "browserstack-node-sdk": "1.34.17", "nx-cloud": "19.1.0" },
"dependencies": {
"@changesets/cli": "^2.27.9",
"browserstack-node-sdk": "1.34.17",
"nx-cloud": "19.1.0"
},
"pnpm": {
"overrides": {
"ssri@>=5.2.2 <6.0.2": ">=6.0.2",
Expand Down
Loading

0 comments on commit fb28d4a

Please sign in to comment.