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

chore: add jsr-release workflow and update package.json exports #368

Merged
merged 4 commits into from
Oct 14, 2024
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
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,39 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets. NPM_TOKEN }}

jsr-release:
name: jsr-release
needs: validate
runs-on: ubuntu-latest
if: ${{ github.repository == 'LottieFiles/dotlottie-web' && github.event_name == 'push' }}

permissions:
contents: read
id-token: write

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# related issue https://github.com/denoland/deno/issues/26152
- name: ⎔ Setup .npmrc (NPM) in web package
run: |
echo "@lottiefiles:registry=https://registry.npmjs.org/" >> ./packages/web/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_TOKEN }}" >> ./packages/web/.npmrc

- name: 🔄 Sync version to jsr.json
run: |
VERSION=$(jq -r '.version' ./packages/web/package.json)
jq '.version = $newVersion' --arg newVersion "$VERSION" ./packages/web/jsr.json > temp.json
mv temp.json ./packages/web/jsr.json
cat ./packages/web/jsr.json

- name: 🚀 Release to JSR
run: npx jsr publish
working-directory: packages/web

publish-viewer:
name: publish-viewer
needs: validate
Expand Down
5 changes: 5 additions & 0 deletions packages/web/jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@lottiefiles/dotlottie-web",
"exports": "./src/index.ts",
"license": "MIT"
}
Loading