-
-
Notifications
You must be signed in to change notification settings - Fork 47
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 #168 from throwaway96/workflows-20240203
Refactor workflows
- Loading branch information
Showing
4 changed files
with
89 additions
and
63 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
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,60 @@ | ||
name: 'Build IPK and manifest' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
fail-on-lint-error: | ||
description: 'Fail on lint error' | ||
required: false | ||
default: false | ||
type: boolean | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run lint | ||
run: npm run lint | ||
continue-on-error: ${{ github.event_name != 'workflow_call' || inputs.fail-on-lint-error }} | ||
|
||
- name: Build frontend | ||
run: npm run build -- --production | ||
|
||
- name: Build service | ||
run: npm run build-service -- --env production | ||
|
||
- name: Create IPK | ||
run: npm run package | ||
|
||
- name: Create manifest | ||
run: npm run manifest | ||
|
||
- name: Upload IPK | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: hbchannel-ipk | ||
path: '*.ipk' | ||
if-no-files-found: error | ||
|
||
- name: Upload manifest | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: hbchannel-manifest | ||
path: '*.manifest.json' | ||
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
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,42 +1,37 @@ | ||
name: Build & Release | ||
name: 'Build & Release' | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-release: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- run: npm ci | ||
- run: npm run build -- --production | ||
- run: npm run build-service -- --env production | ||
- run: npm run package | ||
- run: npm run manifest | ||
pattern: 'hbchannel-*' | ||
merge-multiple: true | ||
|
||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/get-release@v1.3.2 | ||
uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Upload Release assets | ||
- name: Upload IPK | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Release ${{ steps.get_release.outputs.tag_name }} | ||
allowUpdates: true | ||
omitNameDuringUpdate: true | ||
omitBodyDuringUpdate: true | ||
omitDraftDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true | ||
artifacts: '*.ipk,org.webosbrew.hbchannel.manifest.json' | ||
artifacts: '*.ipk,*.manifest.json' |