forked from 360trev/ME7Sum
-
Notifications
You must be signed in to change notification settings - Fork 19
47 lines (44 loc) · 1.23 KB
/
windows-build.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
name: Windows Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
env:
artifacts: |
me7sum.exe
ME7Check.exe
README.md
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86
- name: build
run: nmake
- uses: rlespinasse/github-slug-action@v4
if: ${{ github.event_name != 'release' }}
with:
short-length: 6
- uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'release' }}
with:
name: me7sum-${{ env.GITHUB_SHA_SHORT }}-win
path: ${{ env.artifacts }}
- name: Upload windows artifact to release
if: github.event_name == 'release' && github.event.action == 'published'
shell: pwsh
run: |
# replace newlines with spaces
$ARTIFACTS = "${{ env.artifacts }}"
$ARTIFACTS = $ARTIFACTS -replace "`r`n|`n", " "
echo "$ARTIFACTS"
7z a -tzip me7sum-${{ github.ref_name }}-win.zip $ARTIFACTS
gh release upload --clobber ${{ github.ref_name }} me7sum-${{ github.ref_name }}-win.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}