From d317062787f407fa93bc6735262d1c0cf1b5d1df Mon Sep 17 00:00:00 2001 From: Cheng Date: Thu, 19 Dec 2024 16:02:49 +0900 Subject: [PATCH] Update GitHub Actions deps --- .github/workflows/main.yml | 35 ++++++++++++++++++++--------------- scripts/bootstrap.js | 2 +- scripts/common.js | 2 +- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index efb2c6f..fc7062a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,18 +4,23 @@ on: push jobs: build: - runs-on: ${{ matrix.os }} + runs-on: >- + ${{ + (matrix.os == 'mac' && matrix.arch == 'arm64') && + 'macos-15' || + (fromJson('{"linux":"ubuntu-22.04","mac":"macos-13","win":"windows-2022"}')[matrix.os]) + }} continue-on-error: false strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022, macos-14] + os: [linux, mac, win] arch: [x64] include: - - os: ubuntu-22.04 + - os: linux arch: arm64 - - os: macos-14 + - os: mac arch: arm64 steps: @@ -23,11 +28,6 @@ jobs: if: runner.os == 'linux' && matrix.arch == 'arm64' run: sudo apt install -y binutils-aarch64-linux-gnu - - name: Use Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: '3.11' - - name: Checkout uses: actions/checkout@v3 @@ -44,25 +44,30 @@ jobs: run: node scripts/test.js - name: Upload - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 with: - path: | - out/Release/gn_*.zip + name: gn-${{ matrix.os }}-${{ matrix.arch }} + path: out/Release/gn_*.zip retention-days: 1 release: if: startsWith(github.ref, 'refs/tags/') needs: [build] runs-on: ubuntu-latest + permissions: + # Needed by action-gh-release. + contents: write steps: - name: Download Files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 + with: + merge-multiple: true - name: Release - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 with: draft: true name: build-gn ${{ github.ref_name }} body: '## Changelog' - files: artifact/*.zip + files: '*.zip' diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js index 15ef96a..e2ba638 100755 --- a/scripts/bootstrap.js +++ b/scripts/bootstrap.js @@ -47,7 +47,7 @@ if (targetOs == 'linux') { // Link with libc++ statically. releaseConfig.push('use_custom_libcxx=true') } else if (targetOs == 'mac') { - commonConfig.push('mac_sdk_min="10.12"') + commonConfig.push('mac_sdk_min="11"') } gen('out/Debug', debugConfig) diff --git a/scripts/common.js b/scripts/common.js index 1d99ff7..b754276 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -31,7 +31,7 @@ process.env.PATH = `${binaries_dir}${path.delimiter}${process.env.PATH}` const version = String(execSync('git describe --always --tags')).trim() // Get target_cpu from args.gn. -let targetCpu = 'x64' +let targetCpu = process.arch if (fs.existsSync('out/Release/args.gn')) { const content = String(fs.readFileSync('out/Release/args.gn')) const match = content.match(/target_cpu = "(.*)"/)