Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate changesets to automate the release workflow #273

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
27 changes: 15 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,25 @@ jobs:
run: |
yarn build

- name: Bump Version
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "asgardeo-github-bot"
yarn run bump-${{ github.event.inputs.Type }}-version
git push --follow-tags

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: yarn publish:packages
version: yarn version:packages
commit: "[Asgardeo Release] [GitHub Actions] Update package versions"
title: "[Release] [GitHub Action] Update package versions"
env:
GITHUB_TOKEN: ${{ secrets.ASGARDIO_GITHUB_BOT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Pack Release Artifacts
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
mkdir artifacts
if test -d samples
Expand All @@ -83,6 +94,7 @@ jobs:
fi

- name: Release Asgardeo Auth React SDK
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
version=`git describe --tags --abbrev=0`
echo ${{secrets.ASGARDIO_GITHUB_BOT_TOKEN}} | gh auth login --with-token
Expand All @@ -92,12 +104,3 @@ jobs:
else
gh release create $version
fi

- name: Publish Asgardeo Auth React SDK
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
cp README.md lib
cd lib
npm publish --access public
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
"clean-all": "yarn run remove-package-lock && yarn run remove-yarn-lock && yarn run remove-node-modules",
"bump-patch-version": "lerna version patch --yes",
"bump-minor-version": "lerna version minor --yes",
"bump-major-version": "lerna version major --yes"
"bump-major-version": "lerna version major --yes",
"publish:packages": "changeset publish",
"version:packages": "changeset version",
"changeset": "changeset"
},
"repository": {
"type": "git",
Expand All @@ -35,6 +38,7 @@
},
"homepage": "https://github.com/asgardeo/asgardeo-auth-react-sdk#readme",
"devDependencies": {
"@changesets/cli": "^2.27.12",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"eslint": "^8.30.0",
Expand Down
Loading