forked from SAHorowitz/MSFS2020-PilotPathRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 1.92 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
name: Build
on:
push:
tags:
- '*-release'
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup Package Manager
uses: NuGet/setup-nuget@v1
- name: Resolve Dependencies
run: nuget restore FS2020PlanePath.sln
- name: Build Solution
run: msbuild FS2020PlanePath.sln /p:Configuration=Release
- name: Add Build Manifest
id: build-manifest
run: |
$env:BUILD_TAG=(-join('${{ github.ref }}'.split('/')[2], '.', '${{ github.run_id }}'))
echo "$env:BUILD_TAG" > FS2020PlanePath/bin/Release/build_tag.txt
echo "::set-output name=BUILD_TAG::$env:BUILD_TAG"
- name: Save Assets
uses: actions/upload-artifact@v2
with:
name: MSFS2020-PilotPathRecorder-n2
path: FS2020PlanePath/bin/
retention-days: 30
- name: Create GitHub Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.build-manifest.outputs.BUILD_TAG }}
release_name: Release ${{ steps.build-manifest.outputs.BUILD_TAG }}
- name: Build Release Deliverable
run: |
Compress-Archive -Path FS2020PlanePath\bin\Release\* -DestinationPath PilotPathRecorder-n2.zip
- name: Upload Release Deliverable
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: PilotPathRecorder-n2.zip
asset_name: PilotPathRecorder-n2-${{ steps.build-manifest.outputs.BUILD_TAG }}.zip
asset_content_type: application/zip