-
-
Notifications
You must be signed in to change notification settings - Fork 127
84 lines (75 loc) · 2.78 KB
/
ci.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: release
on:
push:
tags:
- "v*"
branches:
- "*"
jobs:
build:
name: build-windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Figure out if we're running for a tag
id: checktag
run: |
cd ${{ github.workspace }}
If($Env:GITHUB_REF -match "v([0-9]*)\.([0-9]*)\.([0-9]*)") {
$IsRelease = "yes";
$Version = $Matches[0];
$VersionMajor = $Matches[1];
$VersionMinor = $Matches[2];
$VersionPatch = $Matches[3];
} Else {
$IsRelease = "no";
$Version = (git describe --dirty --broken --always);
If($Version -match "v([0-9]*)\.([0-9]*)\.([0-9]*)-.*") {
$VersionMajor = $Matches[1];
$VersionMinor = $Matches[2];
$VersionPatch = $Matches[3];
} Else {
$VersionMajor = 0;
$VersionMinor = 0;
$VersionPatch = 0;
}
}
Echo ("is_release=" + $IsRelease) >> $Env:GITHUB_OUTPUT;
Echo ("version=" + $Version) >> $Env:GITHUB_OUTPUT;
Echo ("version_major=" + $VersionMajor) >> $Env:GITHUB_OUTPUT;
Echo ("version_minor=" + $VersionMinor) >> $Env:GITHUB_OUTPUT;
Echo ("version_patch=" + $VersionPatch) >> $Env:GITHUB_OUTPUT;
- name: Build Algorithms
run: |
cd ${{ github.workspace }}
.\build_algorithms.ps1
- name: Build OpenHashTab
run: |
cd ${{ github.workspace }}
$Env:CI_VERSION = "${{ steps.checktag.outputs.version }}";
$Env:CI_VERSION_MAJOR = "${{ steps.checktag.outputs.version_major }}";
$Env:CI_VERSION_MINOR = "${{ steps.checktag.outputs.version_minor }}";
$Env:CI_VERSION_PATCH = "${{ steps.checktag.outputs.version_patch }}";
.\build_openhashtab.ps1
- name: Build Installer
run: |
iscc .\installer.iss -DCI_VERSION="${{ steps.checktag.outputs.version }}" -DCI_VERSION_NUMERIC="${{ steps.checktag.outputs.version_major }}.${{ steps.checktag.outputs.version_minor }}.${{ steps.checktag.outputs.version_patch }}"
- name: Upload Installer
uses: actions/upload-artifact@v3
with:
name: setup
path: |
.\OpenHashTab_setup.exe
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ steps.checktag.outputs.is_release == 'yes' }}
with:
files: |
.\OpenHashTab_setup.exe
asset_path: .\symbols.7z
name: Release ${{ steps.checktag.outputs.version }}
prerelease: true