From a570425ffaa3d04622a6c2ff9895a2f02431b7d0 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 16:57:55 -0500 Subject: [PATCH 1/7] chore: fix oclif promote channel --- .github/workflows/manual-release.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index c04556bf..8f537461 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -31,8 +31,20 @@ jobs: - name: Get version id: version run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + - name: Determine Oclif channel + id: oclif-channel + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ "$VERSION" == *"-beta"* ]]; then + echo "oclif_channel=beta" >> $GITHUB_OUTPUT + elif [[ "$VERSION" == *"-alpha"* ]]; then + echo "oclif_channel=alpha" >> $GITHUB_OUTPUT + else + echo "oclif_channel=stable" >> $GITHUB_OUTPUT + fi outputs: version: ${{ steps.version.outputs.version }} + oclif_channel: ${{ steps.oclif-channel.outputs.oclif_channel }} test: runs-on: ubuntu-latest @@ -101,8 +113,8 @@ jobs: # Promote to channel npx oclif promote \ - --channel=${{ inputs.channel }} \ - --version=${{ needs.check.outputs.version }} \ + --channel=${{ needs.check-version.outputs.oclif_channel }} \ + --version=${{ needs.check-version.outputs.version }} \ --sha=${{ github.sha }} \ --indexes \ --targets=linux-x64,win32-x64,darwin-arm64 \ @@ -132,8 +144,8 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }} # NPM Release - - name: Create NPM release - if: ${{ !inputs.dry-run }} - run: npm publish --tag ${{ inputs.channel }} --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }} + # - name: Create NPM release + # if: ${{ !inputs.dry-run }} + # run: npm publish --tag ${{ inputs.channel }} --provenance --access public + # env: + # NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }} From a63c5c28eaf17fdb2ce4ffde44e43ea5c5291b30 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:26:20 -0500 Subject: [PATCH 2/7] chore: ensure darwin tarball is clean Previously, each subsequent tarball contained the contents of each previous tarball. --- .github/workflows/manual-release.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 8f537461..22e1c957 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -83,13 +83,33 @@ jobs: sudo apt install nsis p7zip-full p7zip-rar -y - name: Build linux-x64 tarball - run: npx oclif pack tarballs --targets=linux-x64 --no-xz + run: | + mkdir -p dist/linux + cd dist/linux + npx oclif pack tarballs --targets=linux-x64 --no-xz + cd ../.. - name: Build win32-x64 tarball - run: npx oclif pack tarballs --targets=win32-x64 --no-xz + run: | + mkdir -p dist/windows + cd dist/windows + npx oclif pack tarballs --targets=win32-x64 --no-xz + cd ../.. - name: Build darwin-arm64 tarball - run: npx oclif pack tarballs --targets=darwin-arm64 --no-xz + run: | + mkdir -p dist/darwin + cd dist/darwin + npx oclif pack tarballs --targets=darwin-arm64 --no-xz + cd ../.. + + # Move tarballs to dist root + - name: Consolidate tarballs + run: | + mv dist/linux/* dist/ + mv dist/windows/* dist/ + mv dist/darwin/* dist/ + rm -rf dist/linux dist/windows dist/darwin # S3 Distribution - name: Configure AWS credentials From fd34dcd38ce5b924936e9af3fb5c5185c3dfe2cf Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:30:17 -0500 Subject: [PATCH 3/7] chore: another approach to fixing the tarballs --- .github/workflows/manual-release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 22e1c957..b2c14fc2 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -85,23 +85,23 @@ jobs: - name: Build linux-x64 tarball run: | mkdir -p dist/linux - cd dist/linux npx oclif pack tarballs --targets=linux-x64 --no-xz - cd ../.. + mv dist/*linux*.tar.gz dist/linux/ + mv dist/*linux*.buildmanifest dist/linux/ - name: Build win32-x64 tarball run: | mkdir -p dist/windows - cd dist/windows npx oclif pack tarballs --targets=win32-x64 --no-xz - cd ../.. + mv dist/*win32*.tar.gz dist/windows/ + mv dist/*win32*.buildmanifest dist/windows/ - name: Build darwin-arm64 tarball run: | mkdir -p dist/darwin - cd dist/darwin npx oclif pack tarballs --targets=darwin-arm64 --no-xz - cd ../.. + mv dist/*darwin*.tar.gz dist/darwin/ + mv dist/*darwin*.buildmanifest dist/darwin/ # Move tarballs to dist root - name: Consolidate tarballs From 9245c28e555dd8c6e1d9b37047875dc11a7bcbf8 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:32:55 -0500 Subject: [PATCH 4/7] chore: fix filenames --- .github/workflows/manual-release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index b2c14fc2..07b48e55 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -86,22 +86,22 @@ jobs: run: | mkdir -p dist/linux npx oclif pack tarballs --targets=linux-x64 --no-xz - mv dist/*linux*.tar.gz dist/linux/ - mv dist/*linux*.buildmanifest dist/linux/ + mv dist/hd-v*-linux-x64.tar.gz dist/linux/ + mv dist/hd-v*-linux-x64-buildmanifest dist/linux/ - name: Build win32-x64 tarball run: | mkdir -p dist/windows npx oclif pack tarballs --targets=win32-x64 --no-xz - mv dist/*win32*.tar.gz dist/windows/ - mv dist/*win32*.buildmanifest dist/windows/ + mv dist/hd-v*-win32-x64.tar.gz dist/windows/ + mv dist/hd-v*-win32-x64-buildmanifest dist/windows/ - name: Build darwin-arm64 tarball run: | mkdir -p dist/darwin npx oclif pack tarballs --targets=darwin-arm64 --no-xz - mv dist/*darwin*.tar.gz dist/darwin/ - mv dist/*darwin*.buildmanifest dist/darwin/ + mv dist/hd-v*-darwin-arm64.tar.gz dist/darwin/ + mv dist/hd-v*-darwin-arm64-buildmanifest dist/darwin/ # Move tarballs to dist root - name: Consolidate tarballs From 75dc0683cc48d4d009f5afec2dbe15e702c8b3db Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:50:35 -0500 Subject: [PATCH 5/7] chore: try another approach for the nested tarball --- .github/workflows/manual-release.yml | 29 ++-------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 07b48e55..3fcc1fb8 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -82,34 +82,9 @@ jobs: sudo apt update sudo apt install nsis p7zip-full p7zip-rar -y - - name: Build linux-x64 tarball + - name: Build all tarballs in parallel run: | - mkdir -p dist/linux - npx oclif pack tarballs --targets=linux-x64 --no-xz - mv dist/hd-v*-linux-x64.tar.gz dist/linux/ - mv dist/hd-v*-linux-x64-buildmanifest dist/linux/ - - - name: Build win32-x64 tarball - run: | - mkdir -p dist/windows - npx oclif pack tarballs --targets=win32-x64 --no-xz - mv dist/hd-v*-win32-x64.tar.gz dist/windows/ - mv dist/hd-v*-win32-x64-buildmanifest dist/windows/ - - - name: Build darwin-arm64 tarball - run: | - mkdir -p dist/darwin - npx oclif pack tarballs --targets=darwin-arm64 --no-xz - mv dist/hd-v*-darwin-arm64.tar.gz dist/darwin/ - mv dist/hd-v*-darwin-arm64-buildmanifest dist/darwin/ - - # Move tarballs to dist root - - name: Consolidate tarballs - run: | - mv dist/linux/* dist/ - mv dist/windows/* dist/ - mv dist/darwin/* dist/ - rm -rf dist/linux dist/windows dist/darwin + npx oclif pack tarballs --targets=linux-x64,win32-x64,darwin-arm64 --no-xz --parallel # S3 Distribution - name: Configure AWS credentials From 1fa9b84bc918a52af5ba83a2418003a4180ab0d6 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:54:43 -0500 Subject: [PATCH 6/7] chore: fix input to sha flag for promote command --- .github/workflows/manual-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 3fcc1fb8..e00159b0 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -106,11 +106,15 @@ jobs: --targets=linux-x64,win32-x64,darwin-arm64 \ --no-xz + # Get shortened SHA (first 7 characters) + SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7) + echo "Using shortened SHA: $SHORT_SHA" + # Promote to channel npx oclif promote \ --channel=${{ needs.check-version.outputs.oclif_channel }} \ --version=${{ needs.check-version.outputs.version }} \ - --sha=${{ github.sha }} \ + --sha=$SHORT_SHA \ --indexes \ --targets=linux-x64,win32-x64,darwin-arm64 \ --ignore-missing From 54a0b14073d6050b669fa7a568b8851af93e7165 Mon Sep 17 00:00:00 2001 From: Edward Ezekiel Date: Fri, 4 Apr 2025 17:58:16 -0500 Subject: [PATCH 7/7] chore: uncomment npm publish step --- .github/workflows/manual-release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index e00159b0..fd1fcdd8 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -143,8 +143,8 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }} # NPM Release - # - name: Create NPM release - # if: ${{ !inputs.dry-run }} - # run: npm publish --tag ${{ inputs.channel }} --provenance --access public - # env: - # NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }} + - name: Create NPM release + if: ${{ !inputs.dry-run }} + run: npm publish --tag ${{ inputs.channel }} --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.HD_CLI_NPM_TOKEN }}