forked from hmscott4/AlertManagement
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.89 KB
/
build.yml
File metadata and controls
62 lines (54 loc) · 1.89 KB
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
name: Build Management Pack
# When a push occurs to the dev or main branches
on:
push:
branches:
- dev
- main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# Only run when a push occurs to dev or main
if: ( github.ref == 'refs/heads/main' ) || ( github.ref == 'refs/heads/dev' )
# Specify the version of Windows
runs-on: windows-latest
steps:
# Check out the repository the pull request in merging into (dev/main)
- name: Checkout Base Repo
uses: actions/checkout@v2
with:
path: base
token: ${{ secrets.GITHUB_TOKEN }}
# Execute the build PowerShell script
- name: Execute build script
if: ( github.ref == 'refs/heads/main' ) || ( github.ref == 'refs/heads/dev' )
shell: powershell
run: .\base\Build\build.ps1
# Upload the management pack files as artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ManagementPackName }}
path: ${{ env.ArtifactFileName }}
# Create a release of the management pack
- name: Generate Release
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
name: v${{ env.Version }}
tag_name: v${{ env.Version }}
prerelease: false
files: ${{ env.ArtifactFileName }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create a beta release of the management pack
- name: Generate Beta Release
if: github.ref == 'refs/heads/dev'
uses: softprops/action-gh-release@v1
with:
name: v${{ env.Version }}
tag_name: v${{ env.Version }}
prerelease: true
files: ${{ env.ArtifactFileName }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}