-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(typescript-sdk): implement github action to publish npm package (#124
- Loading branch information
Showing
3 changed files
with
57 additions
and
4 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,54 @@ | ||
name: Publish Calimero SDK | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- feat/typescript-sdk-npm-publish-automation | ||
paths: | ||
- "packages/calimero-sdk/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- uses: pnpm/action-setup@v3 | ||
name: Install pnpm | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm buildSdk | ||
|
||
- name: Change to Calimero SDK Directory | ||
run: cd packages/calimero-sdk | ||
|
||
- name: Setup .npmrc file to publish to npm | ||
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc | ||
env: | ||
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | ||
|
||
- name: Publish | ||
run: pnpm publish --access public |
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