-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into feat/stream-rar-and-zip-stream-creation
- Loading branch information
Showing
116 changed files
with
12,684 additions
and
1,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
# Check for outdated actions | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
# Check for updates every Monday | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
name: Build | ||
|
||
on: [push] | ||
on: | ||
# build on each push as we build the stremio-core-web npm package | ||
# and upload it to gh-pages for testing with stremio-web. | ||
# For pull requests we do not build the package and if | ||
# developer pushes a commit without opening a PR | ||
# this will still create a package for testing! | ||
push: | ||
pull_request: | ||
branches: | ||
- development | ||
|
||
# Stops the running workflow of previous pushes | ||
concurrency: | ||
|
@@ -9,8 +18,8 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Lint, test and build | ||
build-core: | ||
name: "stremio-core-*: Lint, test and build" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -21,6 +30,8 @@ jobs: | |
- name: Rust setup (stable) | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Lint - rustfmt | ||
run: cargo fmt --all -- --check | ||
|
||
|
@@ -31,4 +42,98 @@ jobs: | |
run: cargo test | ||
|
||
- name: Build | ||
run: cargo build | ||
run: cargo build | ||
|
||
build-stremio-core-web: | ||
name: "stremio-core-web: test (wasm) and build" | ||
|
||
env: | ||
NODE_VERSION: 12 | ||
WASM_PACK_VERSION: 0.12.1 | ||
# No need to check core-web if core itself is not passing | ||
needs: build-core | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Rust setup | ||
uses: dtolnay/[email protected] | ||
with: | ||
components: rustfmt, clippy, rust-std | ||
targets: wasm32-unknown-unknown | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: wasm-pack@${{ env.WASM_PACK_VERSION }} | ||
|
||
- name: Setup chromedriver | ||
uses: nanasess/setup-chromedriver@v2 | ||
|
||
- name: Run wasm tests (Chrome) | ||
working-directory: stremio-core-web | ||
run: wasm-pack test --chromedriver "$(which chromedriver)" --chrome --headless | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "npm" | ||
registry-url: https://registry.npmjs.org/ | ||
cache-dependency-path: stremio-core-web/package-lock.json | ||
|
||
- name: Install NPM dependencies | ||
working-directory: stremio-core-web | ||
run: npm ci | ||
|
||
- name: Build (release) | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
run: npm run build | ||
|
||
# if merge request, the ref_name will be e.g. `705/merge` | ||
# so we need to recursively create these 2 folders | ||
# create folder for release and dev builds to be published on GH pages | ||
- run: mkdir -p ./build/${{ github.ref_name }}/dev | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
|
||
- name: Package (release) | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
run: npm pack | ||
|
||
- name: Copy release package archive | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
run: mv ./*.tgz ./build/${{ github.ref_name }} | ||
|
||
- name: Build (dev) | ||
working-directory: stremio-core-web | ||
run: npm run build-dev | ||
|
||
- name: Package (dev) | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
run: npm pack | ||
|
||
- name: Copy dev package archive | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') }} | ||
working-directory: stremio-core-web | ||
run: mv ./*.tgz ./build/${{ github.ref_name }}/dev | ||
|
||
- name: Deploy gh-pages | ||
if: ${{ ! startsWith(github.ref, 'refs/pull/') && github.actor != 'dependabot[bot]' }} | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# the build directory already contains the `github.ref_name` as subfolder(s) | ||
publish_dir: ./stremio-core-web/build | ||
# in stremio, we use `feat/features-name` or `fix/this-bug` | ||
# so we need a recursive creation of the destination dir! | ||
destination_dir: ./stremio-core-web/ | ||
# otherwise it clears all existing files and folders in stremio-core-web subdir in gh-pages. | ||
keep_files: true | ||
allow_empty_commit: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Prerelease | ||
|
||
on: | ||
release: | ||
types: [prereleased] | ||
|
||
env: | ||
NODE_VERSION: 12 | ||
WASM_PACK_VERSION: 0.12.1 | ||
|
||
jobs: | ||
prerelease-stremio-core-web: | ||
if: ${{ startsWith(github.ref, 'refs/tags/stremio-core-web') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "npm" | ||
registry-url: https://registry.npmjs.org/ | ||
cache-dependency-path: stremio-core-web/package-lock.json | ||
|
||
- name: Rust setup | ||
uses: dtolnay/[email protected] | ||
with: | ||
targets: wasm32-unknown-unknown | ||
|
||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: wasm-pack@${{ env.WASM_PACK_VERSION }} | ||
|
||
- name: Install NPM dependencies | ||
working-directory: stremio-core-web | ||
run: npm ci | ||
|
||
- name: Build | ||
working-directory: stremio-core-web | ||
run: npm run build | ||
|
||
- name: Package | ||
working-directory: stremio-core-web | ||
run: npm pack | ||
|
||
- name: Upload build artifact to GitHub release assets | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./stremio-core-web/*.tgz | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
env: | ||
NODE_VERSION: 12 | ||
WASM_PACK_VERSION: 0.12.1 | ||
|
||
jobs: | ||
publish-stremio-core-web: | ||
if: ${{ startsWith(github.ref, 'refs/tags/stremio-core-web') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "npm" | ||
registry-url: https://registry.npmjs.org/ | ||
cache-dependency-path: stremio-core-web/package-lock.json | ||
|
||
# For releasing we always use stable | ||
- name: Rust setup | ||
uses: dtolnay/[email protected] | ||
with: | ||
targets: wasm32-unknown-unknown | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: wasm-pack@${{ env.WASM_PACK_VERSION }} | ||
|
||
- name: Install NPM dependencies | ||
working-directory: stremio-core-web | ||
run: npm ci | ||
|
||
- name: Build | ||
working-directory: stremio-core-web | ||
run: npm run build | ||
|
||
- name: Publish to NPM | ||
working-directory: stremio-core-web | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
run: npm publish --access public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
/target | ||
*/target | ||
**/*.rs.bk | ||
|
||
**/node_modules | ||
**/wasm_build | ||
**/stremio_core_web.js | ||
**/bridge.js | ||
**/worker.js | ||
**/stremio_core_web_bg.wasm |
Oops, something went wrong.