-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (55 loc) · 1.77 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build and release bangbib
on:
push:
branches:
- 'master'
tags-ignore:
- '*.*.*'
jobs:
release:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js, NPM
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Dependencies
run: npm install
- name: set version
run: |
echo "export const VERSION = { gitHash: '${{ github.sha }}', buildVersion: '1.1.${{ github.run_number }}', production: true }" > src/version.js
- name: show version
run: cat src/version.js
- name: Build
env:
THE_AUTHOR: ${{ secrets.AUTHOR }}
THE_EMAIL: ${{ secrets.EMAIL }}
run: npm run build -m
- name: Package
run: npm run dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: show dir
run: ls dist
- uses: ncipollo/release-action@v1
with:
artifacts: "./dist/bangbib.msi,./dist/bangbib.dmg,./dist/bangbib.AppImage,./dist/bangbib.snap,./dist/bangbib.rpm,./dist/bangbib.deb"
allowUpdates: true
tag: v1.1.${{ github.run_number }}
token: ${{ secrets.GITHUB_TOKEN }}