diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22408e8..596e721 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,20 +1,26 @@ name: CI +env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + on: push: branches: - main # Runs only when changes are merged into main + workflow_dispatch: jobs: build: runs-on: windows-latest # Electron-builder requires Windows for .exe builds + + steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 23 @@ -27,17 +33,11 @@ jobs: - name: Build Electron App run: npm run electron:build - - name: Move executable to releases folder - run: | - mkdir output - if exist .\dist\SnakeScreen-Setup.exe move .\dist\SnakeScreen-Setup.exe output\SnakeScreen-Setup.exe - if not exist .\dist\SnakeScreen-Setup.exe exit 1 - - name: Upload executable as an artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: SnakeScreen-Setup - path: output/SnakeScreen-Setup.exe + path: dist/SnakeScreen-Setup.exe release: needs: build @@ -49,15 +49,15 @@ jobs: uses: actions/checkout@v3 - name: Download built executable - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: SnakeScreen-Setup - path: output/ + path: dist/ - name: Create GitHub Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: v1.0.${{ github.run_number }} files: output/SnakeScreen-Setup.exe env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} \ No newline at end of file diff --git a/package.json b/package.json index 436854b..a3aa3f9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "npm run app:build && npm run electron:build", + "build": "npm run app:build", "app:build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject",