Skip to content

Commit

Permalink
Publish package to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Mar 30, 2024
1 parent f6b9e1a commit 2965522
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:

lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
Expand All @@ -53,10 +50,27 @@ jobs:
- run: deno task check
- run: deno task check
working-directory: ${{ github.workspace }}/examples/blog/

release-test:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: deno task publish --dry-run
- run: deno task dnt
- run: npm publish --dry-run
working-directory: ${{ github.workspace }}/npm/

publish-jsr:
needs: [test, lint]
publish:
needs: [test, lint, "release-test"]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -67,6 +81,9 @@ jobs:
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/setup-node@v4
with:
node-version: lts/*
- if: github.ref_type == 'branch'
run: |
jq \
Expand All @@ -83,6 +100,9 @@ jobs:
# Don't know why, but the .gitignore list is not overriden by include list
# in deno.json:
- run: rm vocab/.gitignore
- run: 'deno task dnt "$(jq -r .version deno.json)"'
- run: npm pack
working-directory: ${{ github.workspace }}/npm/
- id: extract-changelog
uses: dahlia/submark@5a5ff0a58382fb812616a5801402f5aef00f90ce
with:
Expand All @@ -99,10 +119,16 @@ jobs:
with:
body_path: ${{ steps.extract-changelog.outputs.output-file }}
name: Fedify ${{ github.ref_name }}
files: npm/*.tgz
generate_release_notes: false
discussion_category_name: Announcements
- if: github.event_name == 'push'
run: deno task publish --allow-dirty
- if: github.event_name == 'push'
run: npm publish --provenance --access public *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: ${{ github.workspace }}/npm/

publish-examples-blog:
if: github.event_name == 'push'
Expand Down

0 comments on commit 2965522

Please sign in to comment.