-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (64 loc) · 2.15 KB
/
release.yaml
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
name: Build and Release climateDASH
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
steps:
- name: Check out git repository
uses: actions/checkout@v3.0.0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Copy .npmrc.example to .npmrc
if: matrix.os != 'windows-latest'
run: cp .npmrc.example .npmrc
- name: Replace .npmrc Token
if: matrix.os != 'windows-latest'
run: |
sed -i 's|//npm.pkg.github.com/:_authToken=<Your auth token>|//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}|' .npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Copy .npmrc.example to .npmrc
if: matrix.os == 'windows-latest'
run: copy .npmrc.example .npmrc
- name: Replace .npmrc Token
if: matrix.os == 'windows-latest'
run: |
(Get-Content .npmrc.example) -replace '//npm.pkg.github.com/:_authToken=<Your auth token>', "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" | Set-Content .npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm install
- name: Copy .env.example to .env
if: matrix.os != 'windows-latest'
run: cp .env.example .env
- name: Copy .env.example to .env
if: matrix.os == 'windows-latest'
run: copy .env.example .env
- name: Build
run: npm run build
- name: Package windows
if: matrix.os == 'windows-latest'
run: npm run package-win
- name: Delete Older Releases
uses: dev-drprasad/delete-older-releases@v0.2.1
with:
keep_latest: 0
delete_tag_pattern: alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: 'release/*'
token: ${{ secrets.GITHUB_TOKEN }}