Modernize GitHub Actions workflow

- Bump actions to latest releases and pin to commit SHAs
- Replace deprecated ::set-output + actions/cache with setup-node built-in yarn cache
- Bump Node 18 -> 20
- Use --frozen-lockfile in build job install
This commit is contained in:
Felix Rieseberg
2026-04-11 08:17:18 -07:00
parent 55c4fbb27e
commit 20f7f8c70e

View File

@@ -12,21 +12,12 @@ jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with: with:
node-version: 18.x node-version: 20.x
- name: Get yarn cache directory path cache: yarn
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install - name: Install
run: yarn --frozen-lockfile run: yarn --frozen-lockfile
- name: lint - name: lint
@@ -55,22 +46,12 @@ jobs:
arch: arm64 arch: arm64
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with: with:
node-version: 18.x node-version: 20.x
- name: Get yarn cache directory path cache: yarn
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
if: matrix.os != 'macOS-latest'
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set MacOS signing certs - name: Set MacOS signing certs
if: matrix.os == 'macOS-latest' if: matrix.os == 'macOS-latest'
run: chmod +x tools/add-macos-cert.sh && ./tools/add-macos-cert.sh run: chmod +x tools/add-macos-cert.sh && ./tools/add-macos-cert.sh
@@ -81,7 +62,7 @@ jobs:
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
continue-on-error: true continue-on-error: true
id: write_file id: write_file
uses: timheuer/base64-to-file@v1 uses: timheuer/base64-to-file@784a1a4a994315802b7d8e2084e116e783d157be # v1.2.4
with: with:
fileName: 'win-certificate.pfx' fileName: 'win-certificate.pfx'
encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }} encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }}
@@ -96,7 +77,7 @@ jobs:
env: env:
DISK_URL: ${{ secrets.DISK_URL }} DISK_URL: ${{ secrets.DISK_URL }}
- name: Install - name: Install
run: yarn run: yarn --frozen-lockfile
- name: Make - name: Make
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
run: yarn make --arch=${{ matrix.arch }} run: yarn make --arch=${{ matrix.arch }}
@@ -107,7 +88,7 @@ jobs:
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }} WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }} WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -118,4 +99,4 @@ jobs:
out/**/*.dmg out/**/*.dmg
out/**/*setup*.exe out/**/*setup*.exe
out/**/*.rpm out/**/*.rpm
out/**/*.zip out/**/*.zip