Publish JSR #8
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
name: Publish JSR | |
on: | |
workflow_run: | |
workflows: ['Release'] | |
types: | |
- completed | |
branches: | |
- main | |
jobs: | |
publish: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write # The OIDC ID token is used for authentication with JSR. | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: 1.x | |
- name: Sync Versions and Publish Packages | |
run: | | |
# Run the sync script if needed | |
chmod +x scripts/sync-versions | |
./scripts/sync-versions | |
# Publish each package with a jsr.json | |
for pkg in pkgs/*/; do | |
if [ -f "${pkg}jsr.json" ]; then | |
cd "$pkg" | |
deno publish | |
cd ../../ | |
fi | |
done |