diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6cd1a9c..38da96a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,15 +4,17 @@ on: [ push ] jobs: build: - runs-on: windows-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] node-version: [ 20.x ] steps: - name: Checkout uses: actions/checkout@v4.1.7 + - name: Set up Node.js uses: actions/setup-node@v4 with: @@ -22,10 +24,34 @@ jobs: run: yarn install - name: Build and package for Windows + if: matrix.os == 'windows-latest' run: yarn build:win - - name: Upload artifact + - name: Build and package for macOS + if: matrix.os == 'macos-latest' + run: yarn build:mac + + - name: Build and package for Linux + if: matrix.os == 'ubuntu-latest' + run: yarn build:linux + + - name: Upload artifact for Windows + if: matrix.os == 'windows-latest' uses: actions/upload-artifact@v4 with: name: ExamShowboard-Windows path: dist/*.exe + + - name: Upload artifact for macOS + if: matrix.os == 'macos-latest' + uses: actions/upload-artifact@v4 + with: + name: ExamShowboard-macOS + path: dist/*.dmg + + - name: Upload artifact for Linux + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: ExamShowboard-Linux + path: dist/*.AppImage diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e54b08b --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,65 @@ +name: Build and Package Electron App on Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [windows-latest, macos-latest, ubuntu-latest] + node-version: [20.x] + + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: yarn install + + - name: Build and package for Windows + if: matrix.os == 'windows-latest' + run: yarn build:win + + - name: Build and package for macOS + if: matrix.os == 'macos-latest' + run: yarn build:mac + + - name: Build and package for Linux + if: matrix.os == 'ubuntu-latest' + run: yarn build:linux + + - name: Upload artifact for Windows + if: matrix.os == 'windows-latest' + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/*.exe + asset_name: ExamShowboard-Windows.exe + asset_content_type: application/octet-stream + + - name: Upload artifact for macOS + if: matrix.os == 'macos-latest' + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/*.dmg + asset_name: ExamShowboard-macOS.dmg + asset_content_type: application/octet-stream + + - name: Upload artifact for Linux + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/*.AppImage + asset_name: ExamShowboard-Linux.AppImage + asset_content_type: application/octet-stream