From 2b17ea94a33642ffbcfad6688507ff823b9e8b89 Mon Sep 17 00:00:00 2001 From: Masaharu Tashiro Date: Wed, 23 Oct 2024 23:37:04 +0900 Subject: [PATCH] ci: use artifact --- .github/workflows/test-npm.yml | 55 ++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index ce0443d44b..a41f36e691 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -8,30 +8,32 @@ on: pull_request: jobs: -# prepare: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v4 -# - uses: pnpm/action-setup@v3 -# - uses: actions/setup-node@v4 -# with: -# node-version: "18" -# cache: "pnpm" -# -# - name: Install dependencies -# run: pnpm install --frozen-lockfile -# - run: pnpm build -# - run: pnpm pack -# - id: upload-artifact -# uses: actions/upload-artifact@v4 -# with: -# name: kintone-cli.tgz -# path: kintone-cli-*.tgz -# outputs: -# artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }} + prepare: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + - uses: actions/setup-node@v4 + with: + node-version: "18" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm pack + - run: mv kintone-cli-*.tgz kintone-cli.tgz + - id: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: kintone-cli.tgz + path: kintone-cli.tgz + outputs: + artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }} test-install: name: Test npm install - Node.js ${{ matrix.os }} ${{ matrix.node-version }} + needs: prepare runs-on: ${{ matrix.os }} strategy: matrix: @@ -41,11 +43,15 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - run: npm install -g @kintone/cli + - uses: actions/download-artifact@v4 + with: + name: kintone-cli.tgz + - run: npm install -g kintone-cli.tgz - run: cli-kintone --version test-npx: name: Test npx - Node.js ${{ matrix.os }} ${{ matrix.node-version }} + needs: prepare runs-on: ${{ matrix.os }} strategy: matrix: @@ -55,4 +61,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - run: npx @kintone/cli --version + - uses: actions/download-artifact@v4 + with: + name: kintone-cli.tgz + - run: npx kintone-cli.tgz --version