This repository was archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.76 KB
/
Copy pathmain.yml
File metadata and controls
63 lines (56 loc) · 1.76 KB
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
name: Release Build
on:
push:
tags:
- "*"
jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Load Cache
uses: actions/cache@v2
with:
path: ./node_modules
key: ${{ hashFiles('**/yarn.lock') }}
- name: Update Package Version
id: checkout-tagname
shell: "python3 {0}"
run: |
import os
import re
import json
ref = os.getenv('GITHUB_REF', '')
match = re.search(r'(?<=refs/tags/).*', ref)
tag_name = match[0] if match is not None else '0.0.0'
packagerJson = None
with open('package.json', "r", encoding="utf-8") as f:
packagerJson = json.loads(f.read())
packagerJson['version'] = tag_name
with open('package.json', "w+", encoding="utf-8") as f:
f.write(json.dumps(packagerJson, ensure_ascii=False, sort_keys=False, indent=2))
print('::set-output name=tag_name::'+tag_name)
- name: Build
env:
tag_name: ${{ steps.checkout-tagname.outputs.tag_name }}
run: |
yarn install
yarn run compile
yarn run electron
yarn run _pack -o built/updater-${{ env.tag_name }}.exe -x
dir
dir built
- name: Print Hashes
env:
tag_name: ${{ steps.checkout-tagname.outputs.tag_name }}
run: |
python ci\hash_tool.py built/updater-${{ env.tag_name }}.exe
- name: Upload To Github Release
uses: xresloader/upload-to-github-release@v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
file: built/*
draft: false
tags: true