From 02fc8279a97601a5767617121600586d18a9e1b2 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Mon, 29 Jan 2024 10:59:03 +0100 Subject: [PATCH 1/2] chore: fix node cache for nodeless repos --- .github/workflows/analyze-commits.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analyze-commits.yml b/.github/workflows/analyze-commits.yml index 0650983..18d4a03 100644 --- a/.github/workflows/analyze-commits.yml +++ b/.github/workflows/analyze-commits.yml @@ -26,9 +26,15 @@ jobs: if [[ -f "pnpm-lock.yaml" ]]; then echo "Using pnpm" echo "PACKAGE_MANAGER=pnpm" >> $GITHUB_ENV - else + echo "PACKAGE_MANAGER_CACHE=" >> $GITHUB_ENV + elif [[ -f "yarn.lock" ]]; then echo "Using yarn" echo "PACKAGE_MANAGER=yarn" >> $GITHUB_ENV + echo "PACKAGE_MANAGER_CACHE=yarn" >> $GITHUB_ENV + else + echo "No package manager lock file found" + echo "PACKAGE_MANAGER=yarn" >> $GITHUB_ENV + echo "PACKAGE_MANAGER_CACHE=" >> $GITHUB_ENV fi - if: ${{ env.PACKAGE_MANAGER == 'pnpm' }} name: 'Install pnpm' @@ -39,7 +45,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ inputs.nodeVersion }} - cache: ${{ env.PACKAGE_MANAGER }} + cache: ${{ env.PACKAGE_MANAGER_CACHE }} - name: 'Install Node packages' run: $PACKAGE_MANAGER install - uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe From f1fdd95ef8641b9b59397ec125a6c4c37ceafb9c Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Mon, 29 Jan 2024 12:27:17 +0100 Subject: [PATCH 2/2] chore: update setup-actions to use node20 --- .github/workflows/analyze-commits.yml | 6 +++--- .github/workflows/build-typescript-project.yml | 4 ++-- .github/workflows/coverage-diff.yml | 2 +- .github/workflows/create-pr.yml | 4 ++-- .github/workflows/docs-and-coverage.yml | 2 +- .github/workflows/move-v1-tag.yml | 2 +- .github/workflows/release-dx-packages.yml | 4 ++-- .github/workflows/release-server-sdk.yml | 14 +++++++------- .github/workflows/release-typescript-project.yml | 2 +- README.md | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/analyze-commits.yml b/.github/workflows/analyze-commits.yml index 18d4a03..2407b59 100644 --- a/.github/workflows/analyze-commits.yml +++ b/.github/workflows/analyze-commits.yml @@ -18,7 +18,7 @@ jobs: name: Analyze Commit Messages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Determine package manager' @@ -92,11 +92,11 @@ jobs: env: TEST_MESSAGE: ${{ inputs.isTest && '### ⚠️ This is a test run of the release-notes-comment action that can be found in .github/workflows/analyze-commits.yml' || ''}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Install latest node version' - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ inputs.nodeVersion }} - name: Collect semantic-release-info diff --git a/.github/workflows/build-typescript-project.yml b/.github/workflows/build-typescript-project.yml index 4ba8ec6..8b7b3c4 100644 --- a/.github/workflows/build-typescript-project.yml +++ b/.github/workflows/build-typescript-project.yml @@ -32,13 +32,13 @@ jobs: steps: - name: 'Checkout project for pull_request_target trigger' if: ${{ github.event_name == 'pull_request_target' }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: 'Checkout project for other scenarios' if: ${{ github.event_name != 'pull_request_target' }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Determine package manager' run: | diff --git a/.github/workflows/coverage-diff.yml b/.github/workflows/coverage-diff.yml index b6310ad..ab21f0a 100644 --- a/.github/workflows/coverage-diff.yml +++ b/.github/workflows/coverage-diff.yml @@ -23,7 +23,7 @@ jobs: name: Run tests & check coverage steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Determine package manager' run: | diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml index 6b2804b..d706395 100644 --- a/.github/workflows/create-pr.yml +++ b/.github/workflows/create-pr.yml @@ -23,7 +23,7 @@ jobs: if: inputs.prerelease == false run: exit 1 - name: Checkout rc branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: 'rc' @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: 'main' diff --git a/.github/workflows/docs-and-coverage.yml b/.github/workflows/docs-and-coverage.yml index b1cf2ce..aaca4fa 100644 --- a/.github/workflows/docs-and-coverage.yml +++ b/.github/workflows/docs-and-coverage.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Determine package manager' run: | diff --git a/.github/workflows/move-v1-tag.yml b/.github/workflows/move-v1-tag.yml index d909c3b..6c64ebe 100644 --- a/.github/workflows/move-v1-tag.yml +++ b/.github/workflows/move-v1-tag.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check branch run: | diff --git a/.github/workflows/release-dx-packages.yml b/.github/workflows/release-dx-packages.yml index 1980733..b1b8659 100644 --- a/.github/workflows/release-dx-packages.yml +++ b/.github/workflows/release-dx-packages.yml @@ -14,7 +14,7 @@ jobs: environment: production-npm steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@ebcfd6995dade4b0104ac774445cef8b3b4635b0 @@ -22,7 +22,7 @@ jobs: version: 8 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20.x cache: pnpm diff --git a/.github/workflows/release-server-sdk.yml b/.github/workflows/release-server-sdk.yml index 45a4106..a3edf7a 100644 --- a/.github/workflows/release-server-sdk.yml +++ b/.github/workflows/release-server-sdk.yml @@ -40,12 +40,12 @@ jobs: environment: production steps: - name: 'Checkout repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: 'Install Java' - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' # See 'Supported distributions' for available options java-version: ${{ inputs.java-version }} @@ -53,32 +53,32 @@ jobs: - name: 'Install DotNET' if: ${{ inputs.language == 'dotnet' }} - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.language-version }} - name: 'Install Python' if: ${{ inputs.language == 'python' }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.language-version }} - name: 'Install Golang' if: ${{ inputs.language == 'golang' }} - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ inputs.language-version }} - name: 'Install Flutter' if: ${{ inputs.language == 'flutter' }} - uses: subosito/flutter-action@0c3f14223a08fa950c8a4c00bcfb834e65744135 + uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 with: flutter-version: ${{ inputs.language-version }} channel: 'stable' - name: 'Install PHP' if: ${{ inputs.language == 'php' }} - uses: shivammathur/setup-php@72ae4ccbe57f82bbe08411e84e2130bd4ba1c10f + uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d with: php-version: ${{ inputs.language-version }} coverage: none diff --git a/.github/workflows/release-typescript-project.yml b/.github/workflows/release-typescript-project.yml index 0a1c119..c9ad734 100644 --- a/.github/workflows/release-typescript-project.yml +++ b/.github/workflows/release-typescript-project.yml @@ -38,7 +38,7 @@ jobs: environment: production steps: - name: 'Checkout' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false diff --git a/README.md b/README.md index c626724..df7d4c6 100644 --- a/README.md +++ b/README.md @@ -216,10 +216,10 @@ jobs: matrix: node-version: [ 10, 12, 14, 16, 17, 18, 19, 20 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - uses: actions/download-artifact@v3 @@ -387,7 +387,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # ... other steps ... report-status: