Skip to content

Commit

Permalink
fix: publish pillarbox-suite to npm
Browse files Browse the repository at this point in the history
Automated the process of publishing pillarbox-suite packages to npm by updating necessary
configurations and workflows.

Changes include:

- Updated GitHub Actions workflows to automate the publishing process to npm.
- Modified package.json files to ensure correct npm configuration.
- Added a LICENSE file to each package and updated the `create` script to automatically include one.
  • Loading branch information
jboix committed Jul 2, 2024
1 parent b5000d6 commit 74e7ada
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 93 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Install dependencies
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Install dependencies
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
env:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
always-auth: true
registry-url: https://npm.pkg.github.com/
scope: '@srgssr'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
env :
Expand All @@ -45,4 +40,4 @@ jobs:
run: npm run release:ci -ws
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 1 addition & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,7 @@ To use the components in this suite, you need the following installed on your sy

## Quick Start

To get started with this suite, follow these steps:

Add the `@srgssr` registry to your `.npmrc` file:

```plaintext
//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].

Clone this repository:
To get started with this suite, clone this repository:

```shell
git clone https://github.com/SRGSSR/pillarbox-web-suite.git
Expand Down
15 changes: 7 additions & 8 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"description": "A suite of plugins and themes for pillarbox-web",
"version": "0.0.1",
"license": "MIT",
"author": "SRG SSR",
"repository": {
"type": "git",
"url": "git+https://github.com/SRGSSR/pillarbox-web-suite.git"
},
"publishConfig": {
"access": "public"
},
"homepage": "https://srgssr.github.io/pillarbox-web-suite",
"type": "module",
"workspaces": [
Expand Down
21 changes: 21 additions & 0 deletions packages/pillarbox-playlist/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 SRG SSR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 2 additions & 15 deletions packages/pillarbox-playlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,7 @@ To use this plugin, you need the following installed on your system:

## Quick Start

To get started with this plugin, follow these steps:

Add the `@srgssr` registry to your `.npmrc` file:

```plaintext
//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 this plugin, install it through the following command:

```bash
npm install --save @srgssr/pillarbox-web @srgssr/pillarbox-playlist
Expand Down Expand Up @@ -181,7 +168,7 @@ http://localhost:4200/?language=fr

## Licensing

This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for more
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more
details.

[main-readme]: ../../docs/README.md#Contributing
Expand Down
5 changes: 3 additions & 2 deletions packages/pillarbox-playlist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"description": "Add Playlist management capabilities to video.js",
"version": "1.2.0",
"license": "MIT",
"author": "SRG SSR",
"repository": {
"type": "git",
"url": "git+https://github.com/SRGSSR/pillarbox-web-suite.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
"access": "public"
},
"homepage": "https://srgssr.github.io/pillarbox-web-suite/pillarbox-playlist",
"type": "module",
Expand Down Expand Up @@ -51,6 +52,6 @@
"video.js": "^8.0.0"
},
"devDependencies": {
"@srgssr/pillarbox-web": "^1.12.1"
"@srgssr/pillarbox-web": "^1.12.2"
}
}
21 changes: 21 additions & 0 deletions packages/skip-button/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 SRG SSR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 2 additions & 14 deletions packages/skip-button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ To use this component, you need the following installed on your system:

## Quick Start

To get started with this component, follow these steps:

Add the `@srgssr` registry to your `.npmrc` file:

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

Generate an authentication token by following this
guide: [Authenticating with a personal access token][generate-token]

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

```bash
npm install --save @srgssr/pillarbox-web @srgssr/skip-button
Expand Down Expand Up @@ -88,7 +76,7 @@ http://localhost:4200/?language=fr&urn=urn:rts:video:14318206

## Licensing

This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for more
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more
details.

[main-readme]: ../../docs/README.md#Contributing
Expand Down
5 changes: 3 additions & 2 deletions packages/skip-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"description": "A button to skip certain parts of the content, such as opening credits or end credits",
"version": "1.0.1",
"license": "MIT",
"author": "SRG SSR",
"repository": {
"type": "git",
"url": "git+https://github.com/SRGSSR/pillarbox-web-suite.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
"access": "public"
},
"homepage": "https://srgssr.github.io/pillarbox-web-suite/skip-button",
"type": "module",
Expand Down Expand Up @@ -44,6 +45,6 @@
"test": "vitest run --silent --coverage --coverage.reporter text"
},
"peerDependencies": {
"@srgssr/pillarbox-web": "^1.12.1"
"@srgssr/pillarbox-web": "^1.12.2"
}
}
8 changes: 7 additions & 1 deletion scripts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export default function(plop) {
{
type: 'input',
name: 'name',
message: data => `What is the name of your ${data.type}?`
message: data => `What is the name of your ${data.type}?`,
validate: (value) => {
if ((/.+/).test(value)) { return true; }

return 'Package name is required';
}
},
{
type: 'confirm',
Expand All @@ -52,6 +57,7 @@ export default function(plop) {
] : undefined
},
data: {
currentYear: new Date().getFullYear(),
importAlias: data.platform === 'pillarbox' ? '@srgssr/pillarbox-web' : 'video.js'
}
}
Expand Down
21 changes: 21 additions & 0 deletions scripts/template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) {{currentYear}} SRG SSR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 2 additions & 15 deletions scripts/template/README.md.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,7 @@ To use this {{lowerCase type}}, you need the following installed on your system:

## Quick Start

To get started with this {{lowerCase type}}, follow these steps:

Add the `@srgssr` registry to your `.npmrc` file:

```plaintext
//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 this {{lowerCase type}}, install it through the following command:

```bash
npm install --save {{importAlias}} @srgssr/{{kebabCase name}}
Expand Down Expand Up @@ -91,7 +78,7 @@ http://localhost:4200/?language=fr&urn=urn:rts:video:14318206

## Licensing

This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for more
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more
details.

[main-readme]: ../../docs/README.md#Contributing
Expand Down
3 changes: 2 additions & 1 deletion scripts/template/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "@srgssr/{{kebabCase name}}",
"version": "0.0.1",
"license": "MIT",
"author": "SRG SSR",
"repository": {
"type": "git",
"url": "git+https://github.com/SRGSSR/pillarbox-web-suite.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
"access": "public"
},
"homepage": "https://srgssr.github.io/pillarbox-web-suite/{{kebabCase name}}",
"type": "module",
Expand Down

0 comments on commit 74e7ada

Please sign in to comment.