forked from crazy-max/WindowsSpyBlocker
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (95 loc) 路 2.38 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: build
on:
pull_request:
branches: 'master'
paths:
- '.github/workflows/build.yml'
- 'app/**'
- 'chocolatey/**'
- 'data/**'
- '*.go'
- 'go.mod'
- 'go.sum'
push:
branches: 'master'
tags: '*.*.*'
paths:
- '.github/workflows/build.yml'
- 'app/**'
- 'chocolatey/**'
- 'data/**'
- '*.go'
- 'go.mod'
- 'go.sum'
jobs:
release:
runs-on: windows-latest
steps:
-
name: Prepare
id: prepare
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo ::set-output name=version::${GITHUB_REF#refs/tags/}
else
echo ::set-output name=version::0.0.0
fi
shell: bash
-
name: Checkout
uses: actions/checkout@v2.3.2
-
name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Mage build
uses: magefile/mage-action@v1
with:
version: latest
args: build
-
name: Mage chocoPack
uses: crazy-max/ghaction-mage@v1
if: success()
with:
version: latest
args: chocoPack
-
name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: WindowsSpyBlocker
path: |
bin/WindowsSpyBlocker.exe
bin/windowsspyblocker.${{ steps.prepare.outputs.version }}.nupkg
-
name: GitHub Release
uses: softprops/action-gh-release@v1
if: success() && startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
bin/WindowsSpyBlocker.exe
bin/windowsspyblocker.${{ steps.prepare.outputs.version }}.nupkg
name: ${{ steps.prepare.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Mage chocoPush
uses: crazy-max/ghaction-mage@v1
if: success() && startsWith(github.ref, 'refs/tags/')
env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
with:
version: latest
args: chocoPush