-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.77 KB
/
testAndBuild.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
name: Test and build
on:
workflow_call:
inputs:
official_release:
description: Whether this is an official release
default: false
type: boolean
outputs:
build_version:
description: Version of the built package
value: ${{ jobs.build.outputs.build_version }}
jobs:
build:
runs-on: windows-latest
outputs:
build_version: ${{ steps.output_version.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: x86
python-version: 3.8
cache: pip
- name: Install requirements
run: |
python -m pip install -r requirements.txt
- name: Test
run: |
echo no tests
- name: Set tag name if This is an official release
run: echo "TAG_NAME=$($env:GITHUB_REF.Replace('refs/tags/', ''))" >> $env:GITHUB_ENV
if: ${{ inputs.official_release }}
- name: Build
run: |
python tools\build.py
env:
COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp}}
- name: output version
id: output_version
shell: python
run: |
import os, sys
sys.path.append(os.getcwd())
import buildVars
with open(os.environ["GITHUB_OUTPUT"], mode = "a") as f:
f.write("version="+buildVars.ADDON_VERSION)
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: |
./${{ github.event.repository.name }}-*.zip
./*-*.nvda-addon
./${{ github.event.repository.name }}-*.json