diff --git a/.github/workflows/cd-source.yaml b/.github/workflows/cd-source.yaml index 5a60e9110..20d2fb38b 100644 --- a/.github/workflows/cd-source.yaml +++ b/.github/workflows/cd-source.yaml @@ -80,20 +80,57 @@ jobs: yarn build - name: Package into standalone binary - if: env.TAG_EXISTS == 'false' + if: env.TAG_EXISTS == 'false' && startsWith(matrix.arch, 'arm64') + uses: uraimo/run-on-arch-action@v2 + with: + arch: aarch64 + distro: ubuntu18.04 + githubToken: ${{ secrets.GITHUB_TOKEN }} + install: | + apt update && apt -y install curl + curl -fsSL https://deb.nodesource.com/setup_14.x | bash - + apt-get install -y nodejs + curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list + apt update && apt -y install yarn + yarn global add pkg@5.8.1 --prefix /usr/local + pkg --version + run: | + pkg \ + --config ./packages/cli/package.json \ + --target=${{ matrix.node-version }}-${{ matrix.os }}-${{ matrix.arch }} \ + --output ./packages/cli/standalone-binaries/polywrap-${{ matrix.os }}-${{ matrix.arch }} \ + --debug \ + --compress Brotli \ + ./packages/cli/bin/polywrap + + - name: Package into standalone binary + if: env.TAG_EXISTS == 'false' && startsWith(matrix.arch, 'x64') working-directory: ./packages/cli run: | - npx pkg --config ./package.json --target=${{ matrix.node-version }}-${{ matrix.os }}-${{ matrix.arch }} --output ./standalone-binaries/${{ matrix.os }}-${{ matrix.arch }}/polywrap --compress Brotli ./bin/polywrap + npx pkg \ + --config ./package.json \ + --target=${{ matrix.node-version }}-${{ matrix.os }}-${{ matrix.arch }} \ + --output ./standalone-binaries/polywrap-${{ matrix.os }}-${{ matrix.arch }} \ + --compress Brotli \ + ./bin/polywrap - name: Extract binary path if: env.TAG_EXISTS == 'false' - run: echo STANDALONE_BINARY_PATH=$(stat ./packages/cli/standalone-binaries/${{ matrix.os }}-${{ matrix.arch }}/polywrap* | awk '/File:/ {print $2}') >> $GITHUB_ENV + run: | + if [[ "${{ matrix.os }}" == "win" ]]; then + FILE_NAME="polywrap-${{ matrix.os }}-${{ matrix.arch }}.exe" + else + FILE_NAME="polywrap-${{ matrix.os }}-${{ matrix.arch }}" + fi + echo STANDALONE_BINARY_PATH=$(stat ./packages/cli/standalone-binaries/$FILE_NAME | awk '/File:/ {print $2}') >> $GITHUB_ENV + echo FILE_NAME=$FILE_NAME >> $GITHUB_ENV - name: Upload Artifacts if: env.TAG_EXISTS == 'false' uses: actions/upload-artifact@v3 with: - name: cli-binary-${{ matrix.os }}-${{ matrix.arch }} + name: ${{ env.FILE_NAME }} path: ${{ env.STANDALONE_BINARY_PATH }} Publish-GitHub: @@ -157,38 +194,38 @@ jobs: - name: Download Artifacts linux-x64 uses: actions/download-artifact@v3 with: - name: cli-binary-linux-x64 - path: ./bin/linux-x64/ + name: polywrap-linux-x64 + path: ./bin - name: Download Artifacts linux-arm64 uses: actions/download-artifact@v3 with: - name: cli-binary-linux-arm64 - path: ./bin/linux-arm64/ + name: polywrap-linux-arm64 + path: ./bin - name: Download Artifacts macos-x64 uses: actions/download-artifact@v3 with: - name: cli-binary-macos-x64 - path: ./bin/macos-x64/ + name: polywrap-macos-x64 + path: ./bin - name: Download Artifacts macos-arm64 uses: actions/download-artifact@v3 with: - name: cli-binary-macos-arm64 - path: ./bin/macos-arm64/ + name: polywrap-macos-arm64 + path: ./bin - name: Download Artifacts win-x64 uses: actions/download-artifact@v3 with: - name: cli-binary-win-x64 - path: ./bin/win-x64/ + name: polywrap-win-x64.exe + path: ./bin - name: Download Artifacts win-arm64 uses: actions/download-artifact@v3 with: - name: cli-binary-win-arm64 - path: ./bin/win-arm64/ + name: polywrap-win-arm64.exe + path: ./bin - name: Create Release id: create_release @@ -204,7 +241,13 @@ jobs: ${{ github.event.pull_request.body }} draft: false prerelease: false - files: ./bin + files: | + ./bin/polywrap-linux-x64 + ./bin/polywrap-linux-arm64 + ./bin/polywrap-macos-x64 + ./bin/polywrap-macos-arm64 + ./bin/polywrap-win-x64.exe + ./bin/polywrap-win-arm64.exe - uses: actions/github-script@0.8.0 if: env.TAG_EXISTS == 'false'