-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 2.7 KB
/
BuildAndPublish.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
name: BuildAndPublish
on: push
jobs:
build:
name: Build for ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
arch: x86
- os: windows-latest
arch: x64
- os: ubuntu-latest
arch: x86
- os: ubuntu-latest
arch: x64
- os: ubuntu-latest
arch: arm
- os: ubuntu-latest
arch: arm64
steps:
- uses: actions/checkout@v2
- name: Build
run: dotnet build --configuration debug
- name: Get file version
uses: mathiasvr/[email protected]
id: version
with:
run: strings Output/Debug/SkyCoopDedicatedServer.dll | egrep '^[0-9]+\.[0-9]+\.[0-9]+$'
- name: Сreating an archive for Windows ${{ matrix.arch }}
if: matrix.os == 'windows-latest'
run: Compress-Archive -Path Output/Debug -Destination Windows_${{ matrix.arch }}.zip
- name: Сreating an archive for Linux ${{ matrix.arch }}
if: matrix.os == 'ubuntu-latest'
run: zip -r -q Linux_${{ matrix.arch }}.zip Output/Debug
- name: Publishing a release for Windows ${{ matrix.arch }}
if: matrix.os == 'windows-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Windows_${{ matrix.arch }}.zip
asset_name: ${{ matrix.asset_name }}
overwrite: true
release_name: SkyCoop Dedicated Server for mod version ${{ steps.version.outputs.stdout }}
body: ${{ github.event.head_commit.message }}
tag: ${{ steps.version.outputs.stdout }}
- name: Publishing a release for Linux ${{ matrix.arch }}
if: matrix.os == 'ubuntu-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Linux_${{ matrix.arch }}.zip
asset_name: ${{ matrix.asset_name }}
overwrite: true
release_name: SkyCoop Dedicated Server for mod version ${{ steps.version.outputs.stdout }}
body: ${{ github.event.head_commit.message }}
tag: ${{ steps.version.outputs.stdout }}