From 3e4ff6614a8df61493855a7bab33ce94c6e833a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=85=E6=88=8E=E6=B0=8F?= Date: Fri, 8 Mar 2024 11:16:03 +0800 Subject: [PATCH] ci: update actions/upload-artifact --- .github/workflows/macos-build.yml | 26 +++++++++++++++++--------- .github/workflows/release-ci.yml | 7 +++++-- .github/workflows/windows-build.yml | 6 ++++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index a2035f0543..2c1bfe38e2 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -14,11 +14,16 @@ on: type: string jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} strategy: fail-fast: false matrix: - os: [macos-13, macos-14] + runs-on: [macos-13, macos-14] + include: + - runs-on: macos-13 + create-distributable: ${{ !inputs.build_variant }} + - runs-on: macos-14 + create-distributable: ${{ !inputs.build_variant || inputs.build_variant == 'universal' }} env: boost_version: 1.84.0 BOOST_ROOT: ${{ github.workspace }}/deps/boost-1.84.0 @@ -38,7 +43,7 @@ jobs: echo git_ref_name="$(git describe --always)" >> $GITHUB_ENV - name: Configure build variant - if: contains(inputs.build_variant, '-universal') + if: inputs.build_variant == 'universal' run: | echo BUILD_UNIVERSAL=1 >> $GITHUB_ENV @@ -57,7 +62,7 @@ jobs: include lib share - key: ${{ matrix.os }}${{ inputs.build_variant }}-deps-${{ hashFiles('submodule-status') }} + key: ${{ runner.os }}-${{ inputs.build_variant || runner.arch }}-deps-${{ hashFiles('submodule-status') }} - name: Build dependencies if: steps.cache-deps.outputs.cache-hit != 'true' @@ -70,17 +75,20 @@ jobs: run: make test - name: Create distributable + if: matrix.create-distributable run: | make install - tar -cjvf rime-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 \ + tar -cjvf rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ inputs.build_variant || runner.arch }}.tar.bz2 \ dist version-info.txt - tar -cjvf rime-deps-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 \ + tar -cjvf rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ inputs.build_variant || runner.arch }}.tar.bz2 \ --exclude '*/.placeholder' \ bin include lib share - name: Upload artifacts - uses: actions/upload-artifact@v3 + if: matrix.create-distributable + uses: actions/upload-artifact@v4 with: + name: artifact-${{ runner.os }}-${{ inputs.build_variant || runner.arch }} path: | - rime-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 - rime-deps-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 + rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ inputs.build_variant || runner.arch }}.tar.bz2 + rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ inputs.build_variant || runner.arch }}.tar.bz2 diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 5ec226053a..ef7f0e31c1 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -15,7 +15,7 @@ jobs: macos: uses: ./.github/workflows/macos-build.yml with: - build_variant: '-universal' + build_variant: universal rime_plugins: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict windows: @@ -28,7 +28,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 + with: + path: artifact + merge-multiple: true - name: Create Nightly release if: ${{ github.ref == 'refs/heads/master' }} diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b0aa1f2efb..8e89c834f8 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -97,8 +97,9 @@ jobs: bin include lib share - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: + name: artifact-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }} path: | rime-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z rime-deps-${{ env.git_ref_name }}-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.arch }}.7z @@ -169,7 +170,8 @@ jobs: bin include lib share - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: + name: artifact-${{ runner.os }}-mingw path: | rime-${{ env.git_ref_name }}-${{ runner.os }}-mingw.tar.bz2