forked from ratkosrb/HermesProxy
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 3.05 KB
/
Build_Proxy.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
name: Build Proxy
on: ['push']
env:
DOTNET_VERSION: '6.0.x'
jobs:
build:
strategy:
matrix:
os: ['windows', 'ubuntu', 'macos']
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
run: dotnet restore
- name: Publish
if: matrix.os != 'macos'
run: dotnet publish --configuration Release --use-current-runtime -p:UsePublishBuildSettings=true
- name: Publish (MacOS x86_64 and arm64)
if: matrix.os == 'macos'
run: |
dotnet publish --configuration Release --runtime osx-arm64 -p:UsePublishBuildSettings=true
dotnet publish --configuration Release --runtime osx-x64 -p:UsePublishBuildSettings=true
lipo ./HermesProxy/bin/Release/*/publish/HermesProxy -create -output ./HermesProxy/bin/Release/osx-x64/publish/HermesProxy_universal
mv ./HermesProxy/bin/Release/osx-x64/publish/HermesProxy_universal ./HermesProxy/bin/Release/osx-x64/publish/HermesProxy
rm -rf ./HermesProxy/bin/Release/osx-arm64
- name: Copy files
run: cp -r ./HermesProxy/bin/Release/*/publish/ publish
- name: Mark as executable
if: matrix.os != 'windows'
run: chmod a+x publish/HermesProxy
- name: Make a tar.gz with permissions out of it (for Linux)
if: matrix.os == 'ubuntu'
run: |
mv publish HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}
tar -czvf HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}.tar.gz HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}
- name: Make a zip with permissions out of it (for MacOS)
if: matrix.os == 'macos'
run: |
mv publish HermesProxy-${{ matrix.os }}-universal-${{ github.sha }}
zip -vr HermesProxy-${{ matrix.os }}-universal-${{ github.sha }}.zip HermesProxy-${{ matrix.os }}-universal-${{ github.sha }}
- name: Upload build artifact (Windows)
if: matrix.os == 'windows'
uses: actions/upload-artifact@v3
with:
name: HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}
path: publish
if-no-files-found: error
- name: Upload build artifact (Linux)
if: matrix.os == 'ubuntu'
uses: actions/upload-artifact@v3
with:
name: HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}
path: HermesProxy-${{ matrix.os }}-${{ runner.arch }}-${{ github.sha }}.*
if-no-files-found: error
- name: Upload build artifact (MacOS)
if: matrix.os == 'macos'
uses: actions/upload-artifact@v3
with:
name: HermesProxy-${{ matrix.os }}-universal-${{ github.sha }}
path: HermesProxy-${{ matrix.os }}-universal-${{ github.sha }}.*
if-no-files-found: error