-
Notifications
You must be signed in to change notification settings - Fork 26
141 lines (134 loc) · 4.51 KB
/
release.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
131
132
133
134
135
136
137
138
139
140
141
name: Release
on:
milestone:
types: [closed]
env:
TARGET: Release
jobs:
windows_build:
name: Windows Build
runs-on: windows-2022
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup Environment
run: make environment
- name: Build
run: make build-msvc
- name: Upload Library (x86)
uses: actions/upload-artifact@v2
with:
name: win-x86
path: build/libs/msvc/Win32/src/Release/*.dll*
- name: Upload Library (x64)
uses: actions/upload-artifact@v2
with:
name: win-x64
path: build/libs/msvc/x64/src/Release/*.dll*
linux_build:
name: Linux Build
runs-on: ubuntu-latest
env:
compiler: clang
compiler_version: 10
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Update Environment
run: |
sudo apt-get update
if [ "${{ env.compiler }}" = "gcc" ]; then
echo "CC=gcc-${{ env.compiler_version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ env.compiler_version }}" >> $GITHUB_ENV
else
sudo apt-get install -y clang-${{ env.compiler_version }} g++-multilib
echo "CC=clang-${{ env.compiler_version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ env.compiler_version }}" >> $GITHUB_ENV
fi
- name: Configure Environment
run: make environment
- name: Build
run: make build
- name: Upload Library
uses: actions/upload-artifact@v2
with:
name: linux-x64
path: build/libs/x86_64/Release/src/*.so
macos_build:
name: MacOS Build
runs-on: macos-latest
env:
compiler_version: 12.5.1
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Compiler
run: sudo xcode-select -switch /Applications/Xcode_${{ env.compiler_version }}.app
- name: Configure Environment
run: make environment
- name: Build
run: make build
- name: Upload Library
uses: actions/upload-artifact@v2
with:
name: osx-x64
path: build/libs/x86_64/Release/src/*.dylib
package:
name: Upload Package
needs: [linux_build, windows_build, macos_build]
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Get Windows x86 Build
uses: actions/download-artifact@v2
with:
name: win-x86
path: build/libs/msvc/Win32/src/Release
- name: Get Windows x64 Build
uses: actions/download-artifact@v2
with:
name: win-x64
path: build/libs/msvc/x64/src/Release
- name: Get Linux Build
uses: actions/download-artifact@v2
with:
name: linux-x64
path: build/libs/x86_64/Release/src
- name: Get MacOS Artifact
uses: actions/download-artifact@v2
with:
name: osx-x64
path: build/libs/x86_64/Release/src
- name: Get Shortened Sha
id: sha
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build and Package
working-directory: bindings/netstandard/ElectionGuard/ElectionGuard.Encryption
run: |
dotnet build -c Release
dotnet pack -c Release --version-suffix "v${{ steps.sha.outputs.sha_short }}"
- name: Get Release Version
id: get_version
uses: greenygh0st/net-proj-release-version@v2
with:
PROJ_FILE: ./bindings/netstandard/ElectionGuard/ElectionGuard.Encryption/ElectionGuard.Encryption.csproj
- name: Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.get_version.outputs.RELEASE_VERSION }}
tag_name: v${{ steps.get_version.outputs.RELEASE_VERSION }}
draft: false
prerelease: false
files: |
./bindings/netstandard/ElectionGuard/ElectionGuard.Encryption/bin/Release/*.nupkg
./build/libs/x86_64/Release/src/*.dylib
./build/libs/x86_64/Release/src/*.so
./build/libs/msvc/x64/src/Release/*.dll*
- name: Push to Nuget.org
working-directory: bindings/netstandard/ElectionGuard/ElectionGuard.Encryption
run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate