Skip to content

Commit

Permalink
fix: publish pillarbox-web to npm
Browse files Browse the repository at this point in the history
Resolves #260 by preparing the continuous integration for npm publishing.

- Updated GitHub Actions workflows to automate the publishing process to npm.
- Modified package.json files to ensure correct npm configuration.
  • Loading branch information
jboix committed Jul 2, 2024
1 parent 72417f4 commit 895e5fd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: npm run release:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Pre-release main tag failed 🫣
if: failure()
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ jobs:
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
- run: |
npm dist-tag add @srgssr/pillarbox-web@$(echo "${{github.ref_name}}" | cut -c 2-) latest
exit 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 1 addition & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,7 @@ experience of SRGSSR content, making it more accessible and feature-rich.

## Quick Start

To get started with Pillarbox, add the `@srgssr` registry in your `.npmrc` file:

```text
//npm.pkg.github.com/:_authToken=TOKEN
@srgssr:registry=https://npm.pkg.github.com
```

Generate a personal access token on the [Personal Access Tokens page][token-settings]. For more
information on using tokens with GitHub packages,
visit: [Authenticating with a Personal Access Token][token-guide].

You can now install it through `npm` the following command:
To get started with Pillarbox, install it through the following command:

```bash
npm install --save @srgssr/pillarbox-web
Expand Down
13 changes: 1 addition & 12 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@ Video.js.

## Quick Guide

To get started with Pillarbox, add the `@srgssr` registry in your `.npmrc` file:

```text
//npm.pkg.github.com/:_authToken=TOKEN
@srgssr:registry=https://npm.pkg.github.com
```

Generate a personal access token on the [Personal Access Tokens page][token-settings]. For more
information on using tokens with GitHub packages,
visit: [Authenticating with a Personal Access Token][token-guide].

You can now install it through `npm` the following command:
To get started with Pillarbox, install it through the following command:

```bash
npm install --save @srgssr/pillarbox-web
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"test:watch": "jest --watch --verbose"
},
"keywords": [],
"author": "",
"author": "SRG SSR",
"license": "MIT",
"bugs": {
"url": "https://github.com/SRGSSR/pillarbox-web/issues"
Expand All @@ -61,9 +61,9 @@
"url": "git+https://github.com/SRGSSR/pillarbox-web.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/",
"access": "public"
},
"homepage": "https://srgssr.github.io/pillarbox-web-demo/",
"devDependencies": {
"@babel/core": "^7.24.1",
"@babel/preset-env": "^7.24.1",
Expand Down

0 comments on commit 895e5fd

Please sign in to comment.