-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.83 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (60 loc) · 1.83 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
64
65
66
67
68
69
70
71
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
windows-installer:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Verify release version
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
run: |
$version = (Get-Content VERSION -Raw).Trim()
if ("v$version" -ne "${{ github.ref_name }}") {
throw "Tag ${{ github.ref_name }} does not match VERSION $version"
}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
architecture: x64
cache: pip
- name: Install Python dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install Inno Setup
shell: pwsh
run: choco install innosetup --yes --no-progress
- name: Build Windows installer
shell: pwsh
run: |
$env:FORMULA_OCR_CONDA_ENV = Split-Path (Get-Command python).Source
.\build_installer.ps1
- name: Upload workflow artifact
uses: actions/upload-artifact@v7
with:
name: FormulaOCR-Windows-Installer
path: |
dist/installer/FormulaOCRSetup-*.exe
dist/installer/FormulaOCRSetup-*.exe.sha256
if-no-files-found: error
- name: Publish GitHub Release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
files: |
dist/installer/FormulaOCRSetup-*.exe
dist/installer/FormulaOCRSetup-*.exe.sha256