-
Notifications
You must be signed in to change notification settings - Fork 266
130 lines (107 loc) · 4.26 KB
/
deploy-create-releases.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: BuildAndDeploy_CreateReleaseFromCommit
on:
push:
workflow_dispatch:
inputs:
commit:
type: string
description: Sha1 commit to build and release.
version:
type: string
description: Version to release it as. Eg v2.1.
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# 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
strategy:
matrix:
targetPlatform: [Win32, x64]
env:
BUILD_FILE_PATH: .\${{ matrix.targetPlatform }}\Release\pd.exe
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.commit }}
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- 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 }} /p:Platform=${{ matrix.targetplatform }}
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.targetPlatform }} Executable
path: ${{ env.BUILD_FILE_PATH }}
- name: Upload build artifacts old x86
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.targetPlatform }} Executable
path: .\Release\pd.exe
- name: Upload build artifacts old x64
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.targetPlatform }} Executable
path: .\x64\Release\pd.exe
release:
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
id: executable_x86
with:
name: Win32 Executable
- name: Rename
run: |
ren pd.exe pd32.exe
- uses: actions/download-artifact@v2
id: executable_x64
with:
name: x64 Executable
- name: Rename
run: |
ren pd.exe pd64.exe
- name: Display structure of downloaded files
run: ls -R
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
# Upload release asset: https://github.com/actions/upload-release-asset
- name: Update release asset x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.executable_x86.outputs.download-path }}\pd32.exe
asset_name: pd32.exe
asset_content_type: application/zip
- name: Update release asset x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.executable_x64.outputs.download-path }}\pd64.exe
asset_name: pd64.exe
asset_content_type: application/zip