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
55 lines (49 loc) · 1.56 KB
/
Copy pathtest.yml
File metadata and controls
55 lines (49 loc) · 1.56 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
name: Test
on:
pull_request:
branches:
- main
workflow_dispatch: {}
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 For Test
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