Skip to content

Commit

Permalink
Merge pull request #30 from Stremio/ci/prepare-v1-and-v2-releases
Browse files Browse the repository at this point in the history
Ci/prepare v1 and v2 releases
  • Loading branch information
elpiel authored Jan 12, 2024
2 parents 653eff9 + b8902d9 commit f3825fa
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 31 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ name: Publish
on:
release:
types: [published]

jobs:
# FIXME: needs a running server locally for the local-addon
# publish-v1:
# if: ${{ startsWith(github.event.release.tag_name, 'v1') }}
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup NodeJS
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'npm'
# registry-url: https://registry.npmjs.org/
# - name: Install NPM dependencies
# run: npm ci
# - name: Publish to NPM
# run: npm publish --workspace stremio-official-addons --access public
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
publish-v1:
if: ${{ startsWith(github.event.release.tag_name, 'v1') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci
# At this point, the index.json is manually updated and committed for v1
# No need to generate the addons list
- name: Publish to NPM
run: npm publish --workspace stremio-official-addons --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

publish-v2:
if: ${{ startsWith(github.event.release.tag_name, 'v2') }}
Expand All @@ -41,13 +42,13 @@ jobs:
uses: dtolnay/[email protected]
- name: Install NPM dependencies
run: npm ci
- name: Build
- name: Build addons list
run: npm run --workspace official-addons-v2 build
- name: Publish to NPM
run: npm publish --workspace official-addons-v2 --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish to crates.io
- name: Build and publish crate to crates.io
run: cargo publish -p stremio-official-addons --allow-dirty --token "$CARGO_AUTH_TOKEN"
env:
CARGO_AUTH_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.lock

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

67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,73 @@ Besides changing this module, you have to update all it's dependant packages, mo

* stremio-api-legacy-shim: this one does not *depend on* this module, and does not include it, but it contains a separate list of official add-ons in `addons/official.js` that is respected by all apps using the legacy endpoints **ARCHIVED**

# Release new version

## Version 1.XX.XX
To release a new version for v1 **npm** package you need to:

1. Bump [`package.json`](./package.json)

1.1. Make sure to update [`package-lock.json`](./package-lock.json):

`npm i --package-lock-only`

2. Make a new tag

`git tag -a v1.XX.XX -m "Tag for releases v1.XX.XX"`

3. Push it to the repo

`git push -u origin v1.XX.XX`

4. Create a [new release](https://github.com/Stremio/stremio-official-addons/releases) using the version as a title, e.g. `v1.5.6` and automatically generate changes from previous tag.

5. The [`publish` workflow](./.github/workflows/publish.yml) will run the `v1` job and will:
1. Build [`stremio-official-addons@1`][v1-npm-link] package
2. Publish the [package on npm][v1-npm-link]

## Version 2.XX.XX

To release a new version for v2 **npm** and **crate** packages you need to:
1. Bump [`official-addons-v2/package.json`](./official-addons-v2/package.json)

1.1. Make sure to update [`package-lock.json`](./package-lock.json):

`npm i --package-lock-only`

2. Bump [`official-addons-v2/Cargo.toml`](./official-addons-v2/Cargo.toml)

2.1. Make sure to update [`Cargo.lock`](./Cargo.lock):

`cargo update -p stremio-official-addons`

3. Make a new tag

`git tag -a v2.XX.XX -m "Tag for releases v2.XX.XX"`

4. Push it to the repo

`git push -u origin v2.XX.XX`

5. Create a [new release](https://github.com/Stremio/stremio-official-addons/releases) using the version as a title, e.g. `v2.0.12` and automatically generate changes from previous tag.

6. The [`publish` workflow](./.github/workflows/publish.yml) will run the `v2` job and will:
1. Build [`@stremio/stremio-official-addons@2`][v2-npm-link] package
2. Publish the [package on npm][v2-npm-link]
3. Publish the [crate on crates.io][v2-crates-io-link]

# License

Both packages are licensed under the MIT license:
- [`stremio-official-addons` v1 MIT license](./LICENSE.md)
- [`stremio-official-addons` v2 MIT license](./official-addons-v2/LICENSE.md)

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the project by you, shall be licensed as MIT,
without any additional terms or conditions.

[v1-npm-link]: https://www.npmjs.com/package/stremio-official-addons
[stremio-official-addons downloads badge]: https://img.shields.io/npm/dm/stremio-official-addons?label=stremio-official-addons%20downloads&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fstremio-official-addons

Expand Down
3 changes: 2 additions & 1 deletion official-addons-v2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "stremio-official-addons"
description = "All of the stremio official addons"
version = "2.0.11"
version = "2.0.12"
authors = ["Smart Code OOD"]
edition = "2018"
license = "MIT"
readme = "README.md"
repository = "https://github.com/Stremio/stremio-official-addons"
homepage = "https://stremio.com"
include = [
"/src/**/*.rs",
"/Cargo.toml",
Expand Down
3 changes: 3 additions & 0 deletions official-addons-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ To change what's contained in this module, you have to change `scripts/build.js`

Besides changing this module, you have to update all it's dependant packages.

# License

This project is licensed under the [MIT license](./LICENSE.md).

[v2-npm-link]: https://www.npmjs.com/package/@stremio/stremio-official-addons
[downloads badge]: https://img.shields.io/npm/dm/%40stremio/stremio-official-addons?label=%40stremio%2Fstremio-official-addons%20downloads&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40stremio%2Fstremio-official-addons
Expand Down
3 changes: 2 additions & 1 deletion official-addons-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@stremio/stremio-official-addons",
"version": "2.0.11",
"version": "2.0.12",
"description": "All of the stremio official addons",
"homepage": "https://stremio.com",
"author": "Smart Code OOD",
"main": "addons.json",
"license": "MIT",
Expand Down
10 changes: 6 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stremio-official-addons",
"version": "1.5.5",
"version": "1.5.6",
"description": "All the stremio official add-ons, in AddonCollection.load() format",
"main": "index.js",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"bugs": {
"url": "https://github.com/Stremio/stremio-official-addons/issues"
},
"homepage": "https://github.com/Stremio/stremio-official-addons#readme",
"homepage": "https://stremio.com",
"devDependencies": {
"stremio-addon-client": "^1.5.2",
"stremio-local-addon": "https://[email protected]/Stremio/stremio-local-addon#79cd88c32aa26270af8b662fa7bd92b657f6e14f"
Expand Down

0 comments on commit f3825fa

Please sign in to comment.