-
-
Notifications
You must be signed in to change notification settings - Fork 145
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 #2063 from cewert/workflow-refactor
- Loading branch information
Showing
18 changed files
with
241 additions
and
140 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,27 @@ | ||
name: build-dev | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
dev: | ||
# prevent job from running twice when a PR pushes a new commit | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: NPM install | ||
run: npm ci | ||
- name: Install roku module dependencies | ||
run: npm run ropm | ||
- name: Build app | ||
run: npm run build | ||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | ||
with: | ||
name: Jellyfin-Roku-dev-${{ github.sha }} | ||
path: ${{ github.workspace }}/build/staging | ||
if-no-files-found: error |
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,27 @@ | ||
# Builds the production version of the app | ||
name: build-prod | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
prod: | ||
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'release-prep') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: NPM install | ||
run: npm ci | ||
- name: Install roku module dependencies | ||
run: npm run ropm | ||
- name: Build app for production | ||
run: npm run build-prod | ||
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | ||
with: | ||
name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }} | ||
path: ${{ github.workspace }}/build/staging | ||
if-no-files-found: error |
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,18 @@ | ||
name: lint-brightscript | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/setup-node@master | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npx ropm install | ||
- run: npm run validate | ||
- run: npm run check-formatting |
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,21 @@ | ||
name: lint-json | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone github repo | ||
uses: actions/checkout@master | ||
- uses: actions/setup-node@master | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: Install npm dependencies | ||
run: npm ci | ||
- name: Install roku package dependencies | ||
run: npx ropm install | ||
- name: Validate JSON syntax | ||
run: npm run lint-json |
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,22 @@ | ||
name: lint-markdown | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone github repo | ||
uses: actions/checkout@master | ||
- uses: actions/setup-node@master | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: Install npm dependencies | ||
run: npm ci | ||
- name: Install roku package dependencies | ||
run: npx ropm install | ||
- uses: xt0rted/markdownlint-problem-matcher@1a5fabfb577370cfdf5af944d418e4be3ea06f27 # v3 | ||
- name: Lint markdown files | ||
run: npm run lint-markdown |
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,21 @@ | ||
name: lint-spelling | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone github repo | ||
uses: actions/checkout@master | ||
- uses: actions/setup-node@master | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: Install npm dependencies | ||
run: npm ci | ||
- name: Install roku package dependencies | ||
run: npx ropm install | ||
- name: Check markdown files for spelling errors | ||
run: npm run lint-spelling |
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,24 @@ | ||
name: lint-translation-files | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone github repo | ||
uses: actions/checkout@master | ||
- name: Install xmllint and xmlstarlet using apt (from cache) | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libxml2-utils xmlstarlet | ||
- name: Validate XML syntax | ||
run: xmllint --noout ./locale/en_US/translations.ts | ||
- name: Save output of duplicate check | ||
run: echo "tsDuplicates=$(xmlstarlet sel -t -m '/TS/context/message/source' -c '.' -nl ./locale/en_US/translations.ts | sort | uniq -d | awk '{ printf "%s", $0 }')" >> $GITHUB_ENV | ||
- name: Check for duplicates | ||
run: xmlstarlet sel -t -m '/TS/context/message/source' -f -o ' ' -c '.' -nl ./locale/en_US/translations.ts | sort | uniq -d | ||
- name: Duplicates found | ||
if: env.tsDuplicates != '' | ||
run: exit 1 |
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,40 @@ | ||
name: roku-analysis | ||
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
jobs: | ||
static: | ||
# don't run job on forks and prevent job from running twice when a PR pushes a new commit | ||
if: github.repository == 'jellyfin/jellyfin-roku' && github.event_name != 'pull_request' || github.repository == 'jellyfin/jellyfin-roku' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: "npm" | ||
- name: NPM install | ||
run: npm ci | ||
- name: Install roku module dependencies | ||
run: npm run ropm | ||
- name: Build dev app | ||
if: env.BRANCH_NAME != 'master' | ||
run: npm run build | ||
- name: Build app for production | ||
if: env.BRANCH_NAME == 'master' | ||
run: npm run build-prod | ||
- name: Setup Java | ||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "21" | ||
- name: Download the Static Channel Analysis CLI | ||
run: | | ||
curl -sSL "https://devtools.web.roku.com/static-channel-analysis/sca-cmd.zip" -o sca-cmd.zip | ||
unzip sca-cmd.zip | ||
- name: Run Roku Static Analysis | ||
run: ./sca-cmd/bin/sca-cmd ${{ github.workspace }}/build/staging --exit error |
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,23 @@ | ||
name: validate-dependencies | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint-brightscript: | ||
uses: ./.github/workflows/_lint-brightscript.yml | ||
lint-json: | ||
uses: ./.github/workflows/_lint-json.yml | ||
lint-markdown: | ||
uses: ./.github/workflows/_lint-markdown.yml | ||
lint-spelling: | ||
uses: ./.github/workflows/_lint-spelling.yml | ||
lint-translation-files: | ||
uses: ./.github/workflows/_lint-translation-files.yml | ||
build-dev: | ||
uses: ./.github/workflows/_build-dev.yml | ||
build-prod: | ||
uses: ./.github/workflows/_build-prod.yml | ||
roku-analysis: | ||
uses: ./.github/workflows/_roku-analysis.yml | ||
|
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,10 @@ | ||
name: dependencies | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened] | ||
|
||
jobs: | ||
validate: | ||
if: contains(github.event.pull_request.labels.*.name, 'dependencies') | ||
uses: ./.github/workflows/_validate-dependencies.yml |
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
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
Oops, something went wrong.