-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (65 loc) · 1.94 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
name: CI
on:
push:
paths-ignore:
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
- "docs/**"
- '**.md'
- '**.txt'
- '!CMakeLists.txt'
- 'LICENSE'
pull_request:
paths-ignore:
- "docs/**"
- '**.md'
- '**.txt'
- '!CMakeLists.txt'
- 'LICENSE'
jobs:
build:
name: Build
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
unrar_target: [unrar-win64, unrar-arm64]
include:
- unrar_target: unrar-win64
short_target: win64
- unrar_target: unrar-arm64
short_target: arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: compile-unrar
shell: cmd
env:
vc_arch: ${{ matrix.msvc_arch }}
workdir: ${{ matrix.build_dir }}
run: pwsh -NoProfile -NoLogo -ExecutionPolicy unrestricted -File "./build.ps1" -Target "${{ matrix.short_target }}"
- name: Package release
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
# create package and show sha256 hash
run: |
Set-Location build
# cleanup zip files
Remove-Item -Force *.zip
cpack -G ZIP
$item=Get-Item unrar*.zip
$obj=Get-FileHash -Algorithm SHA256 $item.FullName
$baseName=Split-Path -Leaf $item.FullName
$env:UNRAR_ASSET_NAME="$baseName"
$hashtext=$obj.Algorithm+":"+$obj.Hash.ToLower()
$hashtext|Out-File -Encoding utf8 -FilePath "$baseName.sum"
Write-Host "$env:UNRAR_ASSET_NAME`n$hashtext"
- name: Upload release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
file_glob: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/unrar-*.zip
tag: ${{ github.ref }}
overwrite: true