From cce2d2c9d417671e3086c8c28972a8b76437a583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=E9=87=91=E5=8F=AF=E6=98=8E?= Date: Sat, 24 Oct 2020 14:05:27 +0800 Subject: [PATCH] fix(ci): convert TARGET env var into output var --- .github/workflows/release.yml | 12 +++++++----- .github/workflows/tests.yml | 16 ++++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8e8d406..674205d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,11 @@ jobs: runs-on : ${{ matrix.os }} env: NODE_VERSION: 14 - TARGET: $(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') - ASSET_FILENAME: vim-doge-$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') steps: + - name: Get build info + id: build_info + run: | + echo ::set-output name=target::$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]') - name: Checkout kkoomen/vim-doge uses: actions/checkout@v2 with: @@ -25,7 +27,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} - run: npm ci --no-save - name: Build binary - run: npm run build:binary -- node${{ env.NODE_VERSION }}-${{ env.TARGET }}-x64 ${{ env.ASSET_FILENAME }} + run: npm run build:binary -- node${{ env.NODE_VERSION }}-${{ steps.build_info.outputs.target }}-x64 vim-doge-${{ steps.build_info.outputs.target }} - name: Get release id: get_release uses: bruceadams/get-release@v1.2.2 @@ -34,8 +36,8 @@ jobs: - name: Get asset info id: asset_info run: | - echo ::set-output name=asset_path::./bin/${{ env.ASSET_FILENAME }}.tar.gz - echo ::set-output name=asset_name::${{ env.ASSET_FILENAME }}.tar.gz + echo ::set-output name=asset_path::./bin/vim-doge-${{ steps.build_info.outputs.target }}.tar.gz + echo ::set-output name=asset_name::vim-doge-${{ steps.build_info.outputs.target }}.tar.gz - name: Upload release asset uses: actions/upload-release-asset@v1.0.1 env: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d97ff4d4..16e2c85d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,9 +16,11 @@ jobs: vim-version: [v7.4.2119, head] node-version: [10, 12, 14] runs-on: ${{ matrix.os }} - env: - TARGET: $(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') steps: + - name: Get build info + id: build_info + run: | + echo ::set-output name=target::$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]') - name: Checkout kkoomen/vim-doge uses: actions/checkout@v2 with: @@ -34,7 +36,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci --no-save - name: Build binary - run: npm run build:binary -- node${{ matrix.node-version }}-${{ env.TARGET }}-x64 + run: npm run build:binary -- node${{ matrix.node-version }}-${{ steps.build_info.outputs.target }}-x64 - name: Setup Vim uses: thinca/action-setup-vim@v1 id: vim @@ -52,9 +54,11 @@ jobs: vim-version: [v0.3.2, head] node-version: [10, 12, 14] runs-on: ${{ matrix.os }} - env: - TARGET: $(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]') steps: + - name: Get build info + id: build_info + run: | + echo ::set-output name=target::$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]') - name: Checkout kkoomen/vim-doge uses: actions/checkout@v2 with: @@ -70,7 +74,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci --no-save - name: Build binary - run: npm run build:binary -- node${{ matrix.node-version }}-${{ env.TARGET }}-x64 + run: npm run build:binary -- node${{ matrix.node-version }}-${{ steps.build_info.outputs.target }}-x64 - name: Setup Vim uses: thinca/action-setup-vim@v1 id: vim