Skip to content

Commit

Permalink
Add publish CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tanyav2 committed Nov 25, 2024
1 parent 57b8d8c commit 14be196
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 63 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Package

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,17 @@ npm run test:e2e

## Publishing

1. Bump the version in `package.json`:
First, update the version in package.json.

```json
"version": "0.0.XX"
```

2. Build the package:
Then, commit the version change and create and push a new tag:

```bash
npm run build
git add package.json
git commit -m "Release vX.Y.Z"
git tag vX.Y.Z # where X.Y.Z matches the version in package.json
git push origin main --tags
```

3. Publish the package:

```bash
npm publish
```
This will trigger the GitHub Actions workflow to automatically build and publish the package to `npm`.

4. Go to the [jsdelivr repo](https://github.com/tinfoilanalytics/jsdelivr) and follow the README there to update the hosted version at js.tinfoil.sh.
Finally, go to the [jsdelivr repo](https://github.com/tinfoilanalytics/jsdelivr) and follow the README there to update the hosted version at js.tinfoil.sh.
167 changes: 129 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14be196

Please sign in to comment.