diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fef7950..3c55f85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,27 @@ on: - 'release' workflow_dispatch: jobs: - build-win: - name: 🪟 Build for Windows - runs-on: windows-latest + release: + strategy: + matrix: + include: + - name: 🐧 Linux + os: ubuntu-latest + pnpm-command: 'build:linux' + binary_path: dist/*.deb + asset_name: zeroone.deb + - name: 🪟 Windows + os: windows-latest + pnpm-command: 'build:win' + binary_path: dist/*.exe + asset_name: zeroone.exe + - name: 🍏 Mac + os: macos-latest + pnpm-command: 'build:mac' + binary_path: dist/*.dmg + asset_name: zeroone.dmg + name: ${{ matrix.name }} Release + runs-on: ${{ matrix.os }} steps: - name: 🚚 Checkout latest code uses: actions/checkout@v4 @@ -23,44 +41,14 @@ jobs: - name: 🔨 Build Project run: | pnpm i - pnpm build:win + pnpm ${{ matrix.pnpm-command }} - build-linux: - name: 🐧 Build for Linux - runs-on: ubuntu-latest - steps: - - name: 🚚 Checkout latest code - uses: actions/checkout@v4 - - - name: 🟩 Use Node.js 20.x - uses: actions/setup-node@v4 + - name: 📦 Release binary + uses: svenstaro/upload-release-action@v2 with: - node-version: '20.x' - - - name: ⚡ Setup pnpm - uses: pnpm/action-setup@v3.0.0 - - - name: 🔨 Build Project - run: | - pnpm i - pnpm build:linux - - build-mac: - name: 🍎 Build for MacOS - runs-on: macos-latest - steps: - - name: 🚚 Checkout latest code - uses: actions/checkout@v4 - - - name: 🟩 Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - - name: ⚡ Setup pnpm - uses: pnpm/action-setup@v3.0.0 - - - name: 🔨 Build Project - run: | - pnpm i - pnpm build:mac + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.binary_path }} + asset_name: ${{ matrix.asset_name }} + tag: ${{ github.ref }} + file_glob: true + overwrite: true \ No newline at end of file