diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 64% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 4f04b7c9..a02535c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,29 +1,28 @@ -name: CI +name: Build on: push: - branches: [master] - -defaults: - run: - shell: bash + pull_request: jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: latest cache: yarn + - name: Install dependencies + run: | + yarn install + - name: Build env: S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} @@ -31,12 +30,15 @@ jobs: S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} run: | - yarn install - script/ci-build.sh push - curl --silent ${{ secrets.WEBHOOK_URL }} + script/ci-build.sh ${{ github.event_name }} - name: Upload asar - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: asar path: build/*.asar + + - name: Notify webhook + if: github.event_name == 'push' && github.ref_name == 'master' + run: | + curl --silent ${{ secrets.WEBHOOK_URL }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 53b0b7f8..00000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Pull Request - -on: - pull_request: - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: latest - cache: yarn - - - name: Build - run: | - yarn install - script/ci-build.sh pull_request - - - name: Upload asar - uses: actions/upload-artifact@v3 - with: - name: asar - path: build/*.asar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e202dcd6..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release - -on: - push: - tags: ["**"] - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: latest - cache: yarn - - - name: Build - run: | - yarn install - script/ci-build.sh tag - - - name: Upload asar - uses: actions/upload-artifact@v3 - with: - name: asar - path: build/*.asar diff --git a/script/packager.js b/script/packager.js index 5becf1f5..f4c19e0d 100644 --- a/script/packager.js +++ b/script/packager.js @@ -14,7 +14,7 @@ function clean() { * @param {string} argv */ function build(argv) { - require('electron-packager')({ + require('@electron/packager')({ name: config.productName, executableName: config.name, arch: 'x64',