-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #694 from Stremio/feat/move-stremio-core-web
Feat/move `stremio-core-web`
- Loading branch information
Showing
47 changed files
with
9,865 additions
and
20 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 |
---|---|---|
|
@@ -9,8 +9,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: | ||
|
@@ -33,4 +33,86 @@ 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 | ||
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) | ||
working-directory: stremio-core-web | ||
run: npm run build | ||
|
||
# create folder for release and dev builds to be published on GH pages | ||
- run: mkdir -p ./build/dev | ||
working-directory: stremio-core-web | ||
|
||
- name: Package (release) | ||
working-directory: stremio-core-web | ||
run: npm pack | ||
|
||
- name: Copy release package archive | ||
working-directory: stremio-core-web | ||
run: cp ./*.tgz ./build | ||
|
||
- name: Build (dev) | ||
working-directory: stremio-core-web | ||
run: npm run build-dev | ||
|
||
- name: Package (dev) | ||
working-directory: stremio-core-web | ||
run: npm pack | ||
|
||
- name: Copy dev package archive | ||
working-directory: stremio-core-web | ||
run: cp ./*.tgz ./build/dev | ||
|
||
- name: Deploy gh-pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
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/${{ github.ref_name }} | ||
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
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.