Skip to content

Commit

Permalink
fixes for cli release cd
Browse files Browse the repository at this point in the history
  • Loading branch information
krisbitney committed Sep 13, 2023
1 parent 92cfdd9 commit 5a968af
Showing 1 changed file with 52 additions and 15 deletions.
67 changes: 52 additions & 15 deletions .github/workflows/cd-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 . --target=${{ matrix.node-version }}-${{ matrix.os }}-${{ matrix.arch }} --output ./standalone-binaries/polywrap-${{ matrix.os }}-${{ matrix.arch }} --compress Brotli
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/polywrap-${{ matrix.os }}-${{ matrix.arch }} | 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: polywrap-${{ matrix.os }}-${{ matrix.arch }}
name: ${{ env.FILE_NAME }}
path: ${{ env.STANDALONE_BINARY_PATH }}

Publish-GitHub:
Expand Down Expand Up @@ -158,37 +195,37 @@ jobs:
uses: actions/download-artifact@v3
with:
name: polywrap-linux-x64
path: ./bin/polywrap-linux-x64
path: ./bin

- name: Download Artifacts linux-arm64
uses: actions/download-artifact@v3
with:
name: polywrap-linux-arm64
path: ./bin/polywrap-linux-arm64
path: ./bin

- name: Download Artifacts macos-x64
uses: actions/download-artifact@v3
with:
name: polywrap-macos-x64
path: ./bin/polywrap-macos-x64
path: ./bin

- name: Download Artifacts macos-arm64
uses: actions/download-artifact@v3
with:
name: polywrap-macos-arm64
path: ./bin/polywrap-macos-arm64
path: ./bin

- name: Download Artifacts win-x64
uses: actions/download-artifact@v3
with:
name: polywrap-win-x64
path: ./bin/polywrap-win-x64
name: polywrap-win-x64.exe
path: ./bin

- name: Download Artifacts win-arm64
uses: actions/download-artifact@v3
with:
name: polywrap-win-arm64
path: ./bin/polywrap-win-arm64
name: polywrap-win-arm64.exe
path: ./bin

- name: Create Release
id: create_release
Expand All @@ -204,13 +241,13 @@ jobs:
${{ github.event.pull_request.body }}
draft: false
prerelease: false
files: |
files: |
./bin/polywrap-linux-x64
./bin/polywrap-linux-arm64
./bin/polywrap-macos-x64
./bin/polywrap-macos-arm64
./bin/polywrap-win-x64
./bin/polywrap-win-arm64
./bin/polywrap-win-x64.exe
./bin/polywrap-win-arm64.exe
- uses: actions/github-script@0.8.0
if: env.TAG_EXISTS == 'false'
Expand Down

0 comments on commit 5a968af

Please sign in to comment.