From abeae41a8a506219927c97ad7913c755cd5a987e Mon Sep 17 00:00:00 2001 From: Donald Labaj Date: Wed, 18 Jan 2023 13:31:35 -0500 Subject: [PATCH] fix(github-actions): Fixed github actions. --- .github/workflows/add-to-project.yml | 18 --------- .github/workflows/build-lint-test.yml | 16 ++++---- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++ .github/workflows/release.yml | 5 ++- 4 files changed, 66 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/add-to-project.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index f8faee2..0000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,18 +0,0 @@ - - -name: Add new issues to PatternFly Extensions project - -on: - issues: - types: - - opened - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v0.3.0 - with: - project-url: https://github.com/orgs/patternfly/projects/12 - github-token: ${{ secrets.GH_PROJECTS }} diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index 728e743..2a553a1 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -14,9 +14,9 @@ jobs: git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp fi - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - uses: actions/cache@v2 id: yarn-cache name: Cache npm deps @@ -50,9 +50,9 @@ jobs: git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp fi - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - uses: actions/cache@v2 id: yarn-cache name: Cache npm deps @@ -87,9 +87,9 @@ jobs: git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp fi - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - uses: actions/cache@v2 id: yarn-cache name: Cache npm deps @@ -128,9 +128,9 @@ jobs: git fetch origin pull/$GH_PR_NUM/head:tmp git checkout tmp fi - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - uses: actions/cache@v2 id: yarn-cache name: Cache npm deps diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cf0a969 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: build +on: + workflow_call: +jobs: + build: + runs-on: ubuntu-latest + env: + GH_PR_NUM: ${{ github.event.number }} + steps: + - uses: actions/checkout@v2 + - run: | + if [[ ! -z "${GH_PR_NUM}" ]]; then + echo "Checking out PR" + git fetch origin pull/$GH_PR_NUM/head:tmp + git checkout tmp + fi + - uses: actions/cache@v2 + id: setup-cache + name: Cache setup + with: + path: | + README.md + package.json + .tmplr.yml + packages/*/package.json + packages/*/patternfly-docs/content/** + packages/*/patternfly-docs/generated/** + key: ${{ runner.os }}-setup-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package.json', 'packages/module/package.json') }} + - name: Run build script + run: ./devSetup.sh + shell: bash + if: steps.setup-cache.outputs.cache-hit != 'true' + - uses: actions/setup-node@v3 + with: + node-version: '16' + - uses: actions/cache@v2 + id: yarn-cache + name: Cache npm deps + with: + path: | + node_modules + **/node_modules + key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - uses: actions/cache@v2 + id: dist + name: Cache dist + with: + path: | + packages/*/dist + key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} + - name: Build dist + run: yarn build + if: steps.dist.outputs.cache-hit != 'true' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38a721b..7cb8b72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,10 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/setup-node@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - uses: actions/cache@v2 id: yarn-cache name: Cache npm deps