Skip to content

feat: release binaries #39

feat: release binaries

feat: release binaries #39

Workflow file for this run

name: release
on:
pull_request: # remove me when ready
workflow_dispatch:
permissions:
contents: read
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Check version changes
uses: EndBug/version-check@36ff30f37c7deabe56a30caa043d127be658c425
id: version
with:
diff-search: true
file-name: package.json
build:
strategy:
matrix:
include:
- os: windows-2022
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
- os: macos-14
target: aarch64-apple-darwin
code-target: darwin-arm64
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
needs: check
env:
version: ${{ needs.check.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: '.nvmrc'
- name: Install linux toolchain
if: matrix.code-target == 'linux-x64'
run: |
sudo apt install nsis p7zip-full p7zip-rar -y
- name: Install win32 toolchain
if: matrix.code-target == 'win32-x64'
run: |
choco install 7zip nsis grep -y
echo "C:\Program Files (x86)\GnuWin32\bin" >> $GITHUB_PATH
- name: Install npm dependencies
run: npm ci
- name: Build javascript
run: npm run build
- name: Build binaries
shell: bash
run: |
cd packages/cli-${{ matrix.code-target }}
npm ci
npm run pack
- name: Upload CLI artifact
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: cli-${{ matrix.code-target }}
path: ./packages/cli-${{ matrix.code-target }}/dist/hd-*
if-no-files-found: error