-
Notifications
You must be signed in to change notification settings - Fork 10
130 lines (106 loc) · 3.1 KB
/
build_release.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build and Release
on:
# push:
# branches: [ master ]
# manual dispatch of the workflow
workflow_dispatch:
jobs:
Windows_Build:
# Build executable for windows system
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: '14'
- name: npm install and build
run: |
npm install
echo ${{secrets.GA_TOKEN}} > .env
npm run dist
- name: Display build files
run: ls -l dist
- name: Upload windows build artifacts
uses: actions/upload-artifact@v2
with:
name: windows-builds
path: |
dist/*.exe
dist/*.msi
retention-days: 1
Linux_Build:
# Build executable for linux system
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: '14'
- name: npm install and build
run: |
npm install
echo ${{secrets.GA_TOKEN}} > .env
npm run dist
- name: Display build files
run: ls -l dist
- name: Upload linux build artifacts
uses: actions/upload-artifact@v2
with:
name: linux-builds
path: |
dist/*.snap
dist/*.deb
dist/*.AppImage
retention-days: 1
Snapstore_Release:
needs: [Linux_Build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Download builds
uses: actions/download-artifact@v2
with:
path: artifacts
name: linux-builds
- name: Display build files
run: ls -lR artifacts/
# snapcraft export-login --snaps interactive-data-editor snap.login
- name: Release to Snap store
run: |
sudo snap install snapcraft --classic
# echo "$SNAP_TOKEN" | snapcraft login --with -
snapcraft upload --release=stable artifacts/*.snap
env:
SNAPCRAFT_BUILD_ENVIRONMENT: host
SNAPCRAFT_STORE_CREDENTIALS: ${{secrets.SNAP_TOKEN}}
# SNAP_TOKEN: ${{secrets.SNAP_TOKEN}}
Github_Release:
needs: [Windows_Build, Linux_Build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Download builds
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Display build files
run: ls -lR artifacts/
- name: Get app version
id: app_version
uses: martinbeentjes/npm-get-version-action@master
- name: Release builds to Github
uses: ncipollo/release-action@v1
with:
artifacts: "artifacts/*/*"
allowUpdates: true
tag: v${{ steps.app_version.outputs.current-version}}
token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: true
artifactErrorsFailBuild: true
omitBodyDuringUpdate: true