-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: Better checks for when theme builds should happen
- Loading branch information
Showing
1 changed file
with
14 additions
and
7 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 |
---|---|---|
|
@@ -85,25 +85,29 @@ jobs: | |
steps: | ||
- name: Theme Setup | ||
id: individal_theme | ||
if: ${{ matrix.theme == '["none"]' }} | ||
if: ${{ matrix.theme == 'none' }} | ||
run: | | ||
echo "::warning::Skipping Theme Build" | ||
- name: Checkout code | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
|
||
- name: Get yarn cache directory path | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache Yarn Dependencies | ||
uses: actions/cache@v2 | ||
id: cache-yarn-cache | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
@@ -112,18 +116,21 @@ jobs: | |
- name: Build Theme | ||
id: build-theme | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
run: | | ||
cd themes/${{ matrix.theme }} | ||
yarn install # @todo this should not include dev resources | ||
yarn build | ||
- name: Compress Theme Artifact | ||
id: compress_theme_artifact | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
run: | | ||
tar -zcf theme-${{ matrix.theme }}.tar.gz --exclude "node_modules" themes/${{ matrix.theme }} | ||
- name: Upload Theme | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ matrix.theme != 'none' }} # skip this step if no themes are included. | ||
with: | ||
path: theme-${{ matrix.theme }}.tar.gz | ||
retention-days: 1 # since we keep a release we do not need to store an artifact too long | ||
|
@@ -145,22 +152,22 @@ jobs: | |
echo "::warning::Skipping Plugin Build" | ||
- name: Checkout code | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
|
||
- name: Get yarn cache directory path | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache yarn cache | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
uses: actions/cache@v2 | ||
id: cache-yarn-cache | ||
with: | ||
|
@@ -170,15 +177,15 @@ jobs: | |
${{ runner.os }}-yarn- | ||
- name: Build Plugin | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
id: build-plugin | ||
run: | | ||
cd plugins/${{ matrix.plugin }} | ||
yarn install # @todo exclude dev libraries (make initial non cached build faster) | ||
yarn build | ||
- name: Compress Plugin Artifact | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no themes are included. | ||
if: ${{ matrix.plugin != 'none' }} # skip this step if no plugins are included. | ||
id: compress_plugin_artifact | ||
run: | | ||
tar -zcf plugin-${{ matrix.plugin }}.tar.gz --exclude "node_modules" plugin/${{ matrix.plugin }} | ||
|