-
-
Notifications
You must be signed in to change notification settings - Fork 366
81 lines (77 loc) · 1.86 KB
/
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
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
name: build
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
tags:
- '*.*.*'
env:
VERSION: "0.0.0"
jobs:
release:
runs-on: windows-latest
permissions:
# required to create GitHub release
contents: write
steps:
-
name: Prepare
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
shell: bash
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
-
name: Mage build
uses: magefile/mage-action@v2
with:
version: latest
args: build
-
name: Mage chocoPack
uses: magefile/mage-action@v2
with:
version: latest
args: chocoPack
-
name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: WindowsSpyBlocker
path: |
bin/WindowsSpyBlocker.exe
bin/windowsspyblocker.${{ env.VERSION }}.nupkg
-
name: GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
bin/WindowsSpyBlocker.exe
bin/windowsspyblocker.${{ env.VERSION }}.nupkg
name: ${{ env.VERSION }}
-
name: Mage chocoPush
uses: magefile/mage-action@v2
if: startsWith(github.ref, 'refs/tags/')
env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
with:
version: latest
args: chocoPush