From bcdeeaf20ee1ecd0ef4355cf39c3f34bf1066dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Tue, 19 Nov 2024 02:03:34 +0800 Subject: [PATCH] =?UTF-8?q?github=20actions:=20=E6=B7=BB=E5=8A=A0=20`npm-r?= =?UTF-8?q?un-electron.yml`=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=20`npm=20run=20electron`=20=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/npm-run-electron.yml | 90 ++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/npm-run-electron.yml diff --git a/.github/workflows/npm-run-electron.yml b/.github/workflows/npm-run-electron.yml new file mode 100644 index 0000000..cea16d6 --- /dev/null +++ b/.github/workflows/npm-run-electron.yml @@ -0,0 +1,90 @@ +name: npm run electron + +on: + push: + branches: + - run + +jobs: + npm-run-electron: + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: + - windows + - ubuntu + - macos + node: + - 22 + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + + - name: 'Setup Node.js "${{ matrix.node }}.x" environment' + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + registry-url: https://npm.pkg.github.com/ + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Python environment (Mac) Because of electron-builder install-app-deps requires Python setup tools + if: matrix.os == 'macos' + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Get package info + id: package-info + uses: luizfelipelaviola/get-package-info@v1 + with: + path: ./packages/mitmproxy + + - name: Print + run: | + echo "version = ${{ steps.package-info.outputs.version }}"; + echo "github.ref_type = ${{ github.ref_type }}"; + echo "github.ref = ${{ github.ref }}"; + echo "github.ref_name = ${{ github.ref_name }}"; + + - name: 'npm -v | pnpm -v | python --version' + run: | + echo "======================================================================"; + echo "npm -v"; + echo "--------------------"; + npm -v; + + echo "======================================================================"; + echo "pnpm -v"; + echo "--------------------"; + pnpm -v; + + echo "======================================================================"; + echo "python --version"; + echo "--------------------"; + python --version; + + - name: pnpm install + run: | + echo "======================================================================"; + dir || ls -lah; + + echo "======================================================================"; + echo "pnpm install"; + echo "--------------------"; + pnpm install; + + - name: 'npm run electron' + run: | + echo "======================================================================"; + echo "cd packages/gui"; + echo "--------------------"; + cd packages/gui; + dir || ls -lah; + + echo "======================================================================"; + echo "npm run electron"; + echo "--------------------"; + npm run electron;