From ca03f611c8c07ec3431294764f903da7818e8d4c Mon Sep 17 00:00:00 2001 From: Aaron Ware Date: Mon, 28 Mar 2022 11:20:58 -0400 Subject: [PATCH] improve: Better checks for when theme builds should happen --- .github/workflows/create-release.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 1614458..c8494d0 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -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/setup-node@v3.0.0 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,6 +116,7 @@ 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 @@ -119,11 +124,13 @@ jobs: - 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/setup-node@v3.0.0 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,7 +177,7 @@ 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 }} @@ -178,7 +185,7 @@ jobs: 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 }}