Skip to content

Test to bundle release artifacts #16

Test to bundle release artifacts

Test to bundle release artifacts #16

name: Test to bundle release artifacts
on: [workflow_dispatch]
jobs:
build:
strategy:
matrix:
settings:
- host: macos-latest
target: macos-x64
- host: windows-latest
target: win-x64
extension: .exe
- host: ubuntu-latest
target: linux-x64
runs-on: ${{ matrix.settings.host }}
name: dev build - ${{ matrix.settings.target }} - node@16
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: pnpm i
- run: pnpm build
# remove dev dependencies before packaging
- run: pnpm prune --prod --config.ignore-scripts=true
# package final binaries
- run: |
pnpx pkg . -t node16-${{ matrix.settings.target }} -o bundle/dcli-${{ matrix.settings.target }}${{ matrix.settings.extension }} -C GZip "--public" "--public-packages" "tslib,thirty-two" "--no-bytecode"
- name: Archive binary artifact
uses: actions/upload-artifact@v3
with:
name: dcli-${{ matrix.settings.target }}
path: bundle/dcli-${{ matrix.settings.target }}${{ matrix.settings.extension }}
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: List artifacts
run: ls -R artifacts
shell: bash