-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (90 loc) · 3.84 KB
/
main.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
98
99
100
101
102
103
104
105
106
107
name: Build and release
on:
# Trigger the workflow on push or pull request,
# but only for the dev branch
push:
branches:
- main
paths-ignore:
- 'Firmwares/**'
- '.github/**'
- 'Firmwares.csv'
- 'README.md'
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.https://github.com/jaapvandenhandel/AgOpenGPS/network/members
SOLUTION_FILE_PATH: ./TeensyFlasher.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-latest
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: paulhatch/[email protected]
id: versioning
with:
branch: main
# The prefix to use to identify tags
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
major_pattern: "MAJOR:"
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
minor_pattern: "MINOR:"
# A string to determine the format of the version output
version_format: "v${major}.${minor}.${patch}.${increment}"
bump_each_commit: false
- name: Update AssemblyVersion and AssemblyFileVersion
run: ./SetVersion.ps1 "${{ steps.versioning.outputs.major }}.${{ steps.versioning.outputs.minor }}.${{ steps.versioning.outputs.patch }}.${{ steps.versioning.outputs.increment }}"
shell: powershell
# - name: Update AssemblyVersion and AssemblyFileVersion
# run: ./SetVersion.ps1 "${{ steps.gitversion.outputs.SemVer }}"
# shell: powershell
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}} -PackagesDirectory .\packages -source "https://api.nuget.org/v3/index.json"
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
- name: Directory Listing
shell: cmd
run: dir /s /b
- name: Build Artifact AOGTeensyFlasher
shell: powershell
run: Compress-Archive -Path TeensyFlasher\bin\Release\* -DestinationPath AOGConfigOMatic.zip -Force
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.versioning.outputs.version }} # WAS: ${{ steps.gitversion.outputs.semVer }}
release_name: Release ${{ steps.versioning.outputs.version }} # WAS: ${{ steps.gitversion.outputs.semVer }}
body: |
Automated Release by GitHub Action CI
draft: false
prerelease: false
- name: Upload Release Asset AOGConfigOMatic
id: upload-release-asset-AOGConfigOMatic
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./AOGConfigOMatic.zip
asset_name: AOGConfigOMatic.zip
asset_content_type: application/zip