From dbfc89d9a75ad1dc3970b6fa473d4d182ee382a9 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Fri, 5 Feb 2021 11:30:36 +0800 Subject: [PATCH] CI: build pkg from npm tarball --- .github/workflows/publish-rolling.yml | 40 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish-rolling.yml b/.github/workflows/publish-rolling.yml index 28ae877f..36e6a650 100644 --- a/.github/workflows/publish-rolling.yml +++ b/.github/workflows/publish-rolling.yml @@ -39,6 +39,22 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Upload tarball + uses: actions/upload-artifact@v2 + with: + name: flood + path: ./*.tgz + + - name: Wait until the package is available + uses: nick-invision/retry@v2 + with: + command: curl -f -s https://registry.npmjs.org/@jesec/flood/${{ steps.parse_version.outputs.BUILD_VERSION }} &>/dev/null + timeout_minutes: 30 + max_attempts: 15 + retry_wait_seconds: 15 + + - run: sleep 20 + docker: needs: npm runs-on: ubuntu-20.04 @@ -63,16 +79,6 @@ jobs: run: | echo ::set-output name=BUILD_VERSION::0.0.0-master.`git rev-parse --short HEAD` - - name: Wait until the package is available - uses: nick-invision/retry@v2 - with: - command: curl -f -s https://registry.npmjs.org/@jesec/flood/${{ steps.parse_version.outputs.BUILD_VERSION }} &>/dev/null - timeout_minutes: 30 - max_attempts: 15 - retry_wait_seconds: 15 - - - run: sleep 20 - - name: Publish flood:master to Docker Hub uses: docker/build-push-action@v2 with: @@ -146,6 +152,7 @@ jobs: tags: jesec/rtorrent-flood:master-dbg pkg: + needs: npm runs-on: ubuntu-20.04 strategy: @@ -153,8 +160,6 @@ jobs: node: [15] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v1 with: @@ -163,16 +168,19 @@ jobs: - run: sudo apt install --reinstall -y qemu-user-static - - run: npm ci --no-optional - run: sudo npm install -g @jesec/pkg - - name: Tag rolling release + - uses: actions/download-artifact@v2 + with: + name: flood + + - name: Extract tarball run: | - npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD` + tar xvf *.tgz --strip-components=1 - name: Build executables run: | - npm run build-pkg + pkg . --out-path dist-pkg - name: Rename linuxstatic to linux run: |