Skip to content

Commit

Permalink
improve: Better checks for when theme builds should happen
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronware authored Mar 28, 2022
1 parent 47aaa18 commit ca03f61
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down

0 comments on commit ca03f61

Please sign in to comment.