From 66ccf8d5dccb31bed125af1681e4ada5f775c7e9 Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Wed, 29 May 2024 19:13:05 +0200 Subject: [PATCH 1/5] UPD: Use matrix strategy for GA --- .github/workflows/release.yml | 65 +++++++++++++---------------------- 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e88f55..23039e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,24 @@ on: - 'release' workflow_dispatch: jobs: - build-win: - name: 🪟 Build for Windows - runs-on: windows-latest + release: + name: 🚀 Release + strategy: + matrix: + include: + - os: ubuntu-latest + pnpm-command: 'build:linux' + binary_path: dist/*.deb + asset_name: zeroone-${{ github.ref }}.deb + - os: windows-latest + pnpm-command: 'build:win' + binary_path: dist/*.exe + asset_name: zeroone-${{ github.ref }}.exe + - os: macos-latest + pnpm-command: 'build:mac' + binary_path: dist/*.dmg + asset_name: zeroone-${{ github.ref }}.dmg + runs-on: ${{ matrix.os }} steps: - name: 🚚 Checkout latest code uses: actions/checkout@v4 @@ -23,44 +38,10 @@ jobs: - name: 🔨 Build Project run: | pnpm i - pnpm build:win + pnpm ${{ matrix.pnpm-command }} - build-linux: - name: 🐧 Build for Linux - runs-on: windows-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 + file: ${{ matrix.binary_path }} + asset_name: ${{ matrix.asset_name }} \ No newline at end of file From 15244d20d03099008ab4fd5b335c6714140bf93a Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Wed, 29 May 2024 19:16:21 +0200 Subject: [PATCH 2/5] UPD: Job names --- .github/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23039e5..1bff0ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,22 +6,25 @@ on: workflow_dispatch: jobs: release: - name: 🚀 Release strategy: matrix: include: - - os: ubuntu-latest + - name: 🐧 Linux + os: ubuntu-latest pnpm-command: 'build:linux' binary_path: dist/*.deb asset_name: zeroone-${{ github.ref }}.deb - - os: windows-latest + - name: 🪟 Windows + os: windows-latest pnpm-command: 'build:win' binary_path: dist/*.exe asset_name: zeroone-${{ github.ref }}.exe - - os: macos-latest + - name: 🍏 Mac + os: macos-latest pnpm-command: 'build:mac' binary_path: dist/*.dmg asset_name: zeroone-${{ github.ref }}.dmg + name: ${{ matrix.name }} Release 🚀 runs-on: ${{ matrix.os }} steps: - name: 🚚 Checkout latest code From fa1943d56e878f18f0eb5a1bd98bbfaab5fe5e33 Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Wed, 29 May 2024 19:43:38 +0200 Subject: [PATCH 3/5] UPD: Use GITHUB_TOKEN for releases --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bff0ef..d0f815e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: pnpm-command: 'build:mac' binary_path: dist/*.dmg asset_name: zeroone-${{ github.ref }}.dmg - name: ${{ matrix.name }} Release 🚀 + name: ${{ matrix.name }} Release runs-on: ${{ matrix.os }} steps: - name: 🚚 Checkout latest code @@ -46,5 +46,6 @@ jobs: - name: 📦 Release binary uses: svenstaro/upload-release-action@v2 with: + repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ matrix.binary_path }} asset_name: ${{ matrix.asset_name }} \ No newline at end of file From efda1fada5224a1f073e28fc9048389149ea682d Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Wed, 29 May 2024 20:44:20 +0200 Subject: [PATCH 4/5] FIX: Binary matching --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0f815e..6f53c3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,4 +48,7 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ matrix.binary_path }} - asset_name: ${{ matrix.asset_name }} \ No newline at end of file + asset_name: ${{ matrix.asset_name }} + tag: ${{ github.ref }} + file_glob: true + overwrite: true \ No newline at end of file From 73092ec22d4c5d0e8be3a4fde4a2ab2b2910dc5d Mon Sep 17 00:00:00 2001 From: Robert Kossessa Date: Wed, 29 May 2024 20:49:39 +0200 Subject: [PATCH 5/5] FIX: Release binary names --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f53c3a..3c55f85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,17 @@ jobs: os: ubuntu-latest pnpm-command: 'build:linux' binary_path: dist/*.deb - asset_name: zeroone-${{ github.ref }}.deb + asset_name: zeroone.deb - name: 🪟 Windows os: windows-latest pnpm-command: 'build:win' binary_path: dist/*.exe - asset_name: zeroone-${{ github.ref }}.exe + asset_name: zeroone.exe - name: 🍏 Mac os: macos-latest pnpm-command: 'build:mac' binary_path: dist/*.dmg - asset_name: zeroone-${{ github.ref }}.dmg + asset_name: zeroone.dmg name: ${{ matrix.name }} Release runs-on: ${{ matrix.os }} steps: