From f9e59e3cc7f7448bf215ee04dc7efd306d16726a Mon Sep 17 00:00:00 2001 From: Josh Shor Date: Wed, 22 Nov 2023 11:51:05 -0500 Subject: [PATCH] ci: migrates from hub to gh CLI #124 GitHub Actions has replaced hub CLI with gh CLI, breaking the artifact publishing step. --- .github/workflows/merge.yml | 18 ++++++++++-------- .github/workflows/pr.yml | 4 ++-- README.md | 6 +++--- package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index a0d77dae..e420feae 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -1,9 +1,9 @@ -name: Merge to master +name: Merge to main on: push: branches: - - master + - main release: types: [created] @@ -18,13 +18,15 @@ jobs: if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} strategy: matrix: - os: [windows-2019, macos-latest, ubuntu-latest] + os: [windows-latest, macos-latest, ubuntu-latest] node-version: [16, 18, 20] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Install Python setup tools + run: pip install setuptools - name: Set git credentials run: | git config --global user.email ${{ env.GIT_USER }} @@ -58,7 +60,7 @@ jobs: with: persist-credentials: false - name: Pull latest - run: git pull origin master + run: git pull origin main - name: Install Vuepress run: yarn add vuepress@next -D - name: Build documentation @@ -106,10 +108,10 @@ jobs: set -x assets=() for asset in ./build/stage/**/*; do - assets+=("-a" "$asset") + assets+=("$asset") done RELEASE_VERSION=$(echo $(ls build/stage| head -1)) - hub release create "${assets[@]}" -m "v$RELEASE_VERSION" "$RELEASE_VERSION" + gh release create -t "v$RELEASE_VERSION" "$RELEASE_VERSION" "${assets[@]}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -119,7 +121,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Pull latest - run: git pull origin master + run: git pull origin main - name: Download js bundle uses: actions/download-artifact@v2 with: @@ -127,7 +129,7 @@ jobs: path: dist - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm publish env: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d82dd775..6759e482 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,7 +3,7 @@ name: Pull request on: pull_request: branches: - - master + - main release: types: [created] @@ -13,7 +13,7 @@ jobs: if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} strategy: matrix: - os: [windows-2019, ubuntu-latest, macos-latest] + os: [windows-latest, macos-latest, ubuntu-latest] # list only the earliest and latest node versions supported # this makes PR builds more efficient node-version: [16, 20] diff --git a/README.md b/README.md index edc6e712..fcb42e10 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ Code coverage Build status npm version=14.0.0 <21.0.0" }, "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.10", + "@mapbox/node-pre-gyp": "^1.0.11", "nan": "^2.14.2", "node-fetch": "2", "pngjs": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index 83690784..a4d93744 100644 --- a/yarn.lock +++ b/yarn.lock @@ -778,10 +778,10 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@mapbox/node-pre-gyp@^1.0.10": - version "1.0.10" - resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz#8e6735ccebbb1581e5a7e652244cadc8a844d03c" - integrity sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA== +"@mapbox/node-pre-gyp@^1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" + integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== dependencies: detect-libc "^2.0.0" https-proxy-agent "^5.0.0"