-
-
Save lism/86d802dcbc42e47503ba89158d68704c to your computer and use it in GitHub Desktop.
github action的workflow文件,用于electron打包,请放在项目目录/.github/workflows下面
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: BuildElectron | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| buildwin: | |
| name: BuildWindows | |
| runs-on: windows-latest | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v4 | |
| - name: set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build and package | |
| run: npm run build | |
| - name: Filter Build Artifacts | |
| shell: bash | |
| run: | | |
| mkdir -p filtered-build | |
| for file in $(ls release); do | |
| if [[ $file == latest.yml || $file == RedArchive-Windows* ]]; then | |
| mv release/$file filtered-build/ | |
| fi | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build-artifacts | |
| path: filtered-build/ | |
| buildMac: | |
| name: BuildMac | |
| runs-on: macos-latest | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v4 | |
| - name: set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build and package | |
| run: npm run build | |
| - name: Filter Build Artifacts | |
| shell: bash | |
| run: | | |
| mkdir -p filtered-build | |
| for file in $(ls release); do | |
| if [[ $file == latest*.yml || $file == RedArchive-Mac* ]]; then | |
| mv release/$file filtered-build/ | |
| fi | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac-build-artifacts | |
| path: filtered-build/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment