-
Notifications
You must be signed in to change notification settings - Fork 343
71 lines (56 loc) · 2.04 KB
/
release.yml
File metadata and controls
71 lines (56 loc) · 2.04 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
63
64
65
66
67
68
69
70
71
name: Build and release
on:
push:
branches:
- master
- release/*
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./SourceCode/AgOpenGPS.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
# Path to the output folder
PUBLISH_DIR: ./AgOpenGPS
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v3.2.0
with:
versionSpec: '5.12.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v3.2.0
with:
updateProjectFiles: true
- name: Install dependencies
run: dotnet restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
run: dotnet build --no-restore ${{env.SOLUTION_FILE_PATH}}
- name: Test
run: dotnet test --no-restore --no-build ${{env.SOLUTION_FILE_PATH}}
- name: Publish
run: dotnet publish --no-restore --configuration ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
- name: Create AgOpenGPS_${{ env.GitVersion_SemVer }}.zip
shell: powershell
run: Compress-Archive -Path "${{env.PUBLISH_DIR}}/*" -DestinationPath "AgOpenGPS_${{ env.GitVersion_SemVer }}.zip"
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ env.GitVersion_SemVer }}
tag_name: ${{ env.GitVersion_SemVer }}
target_commitish: ${{ github.sha }}
body: |
Automated Release by GitHub Action CI
draft: ${{ github.ref_name == 'master' }}
prerelease: ${{ contains(github.ref_name, 'release/') }}
files: AgOpenGPS_${{ env.GitVersion_SemVer }}.zip