Skip to content

Commit cb27a3d

Browse files
committed
添加 macos 构建
1 parent 12a11dc commit cb27a3d

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/macos.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: 'MacOS Build'
3+
4+
# Controls when the action will run.
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the master branch
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
branches:
12+
- master
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
build:
20+
strategy:
21+
matrix:
22+
node-version: [14.x, 16.x, 17.x]
23+
24+
# The type of runner that the job will run on
25+
runs-on: macos-latest
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Cache node modules
31+
uses: actions/cache@v2
32+
env:
33+
cache-name: cache-node-modules
34+
with:
35+
# npm cache files are stored in `~/.npm` on Linux/macOS
36+
path: ~/.npm
37+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
38+
restore-keys: |
39+
${{ runner.os }}-build-${{ env.cache-name }}-
40+
${{ runner.os }}-build-
41+
${{ runner.os }}-
42+
- name: Use Node.js ${{ matrix.node-version }}
43+
uses: actions/setup-node@v1
44+
with:
45+
node-version: ${{ matrix.node-version }}
46+
- name: Install Dependencies
47+
run: npm i
48+
- name: Check lint
49+
run: npm run lint
50+
- name: Build the app
51+
run: npm run electron:build

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![License][license-badge]](LICENSE)
55

66
[![Linux Build][linux-build-badge]][linux-build]
7+
[![MacOS Build][macos-build-badge]][macos-build]
78
[![Windows Build][windows-build-badge]][windows-build]
89

910
[![Watch on GitHub][github-watch-badge]][github-watch]
@@ -92,6 +93,8 @@ $> npm run electron:build
9293

9394
[linux-build-badge]: https://github.com/oldrev/branchie/workflows/Linux%20Build/badge.svg
9495
[linux-build]: https://github.com/oldrev/branchie/actions?query=workflow%3A%22Linux+Build%22
96+
[macos-build-badge]: https://github.com/oldrev/branchie/workflows/MacOS%20Build/badge.svg
97+
[macos-build]: https://github.com/oldrev/branchie/actions?query=workflow%3A%22MacOS+Build%22
9598
[windows-build-badge]: https://github.com/oldrev/branchie/workflows/Windows%20Build/badge.svg
9699
[windows-build]: https://github.com/oldrev/branchie/actions?query=workflow%3A%22Windows+Build%22
97100

0 commit comments

Comments
 (0)