-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (129 loc) · 4.53 KB
/
main.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
name: Release
on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]
jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore src
- name: Build
run: dotnet build src --no-restore --configuration Release
- name: Test
run: dotnet test src --no-build --configuration Release --verbosity normal
- name: Publish
run: dotnet publish src/Analog --configuration Release -p:PublishSingleFile=true --self-contained
- name: Zip
run: zip /home/runner/work/analog/analog-linux-x64 /home/runner/work/analog/analog/src/Analog/bin/Release/net8.0/linux-x64/publish/*
- name: Upload
uses: actions/upload-artifact@v4
with:
name: analog-linux-x64
path: /home/runner/work/analog/analog-linux-x64.zip
windows-build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore src
- name: Build
run: dotnet build src --no-restore --configuration Release
- name: Test
run: dotnet test src --no-build --configuration Release --verbosity normal
- name: Publish
run: dotnet publish src/Analog --configuration Release -p:PublishSingleFile=true --self-contained
- name: Zip
shell: pwsh
run: Compress-Archive -Path D:\a\analog\analog\src\Analog\bin\Release\net8.0\win-x64\publish\* -DestinationPath D:\a\analog\analog-win-x64.zip
- name: Upload
uses: actions/upload-artifact@v4
with:
name: analog-win-x64
path: D:\a\analog\analog-win-x64.zip
macos-build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore src
- name: Build
run: dotnet build src --no-restore --configuration Release
- name: Test
run: dotnet test src --no-build --configuration Release --verbosity normal
- name: Publish
run: dotnet publish src/Analog --configuration Release -p:PublishSingleFile=true --self-contained
- name: Zip
run: zip /Users/runner/work/analog/analog-osx-x64 /Users/runner/work/analog/analog/src/Analog/bin/Release/net8.0/osx-x64/publish/*
- name: Upload
uses: actions/upload-artifact@v4
with:
name: analog-osx-x64
path: /Users/runner/work/analog/analog-osx-x64.zip
release:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
needs: [ubuntu-build, windows-build, macos-build]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Build Artifacts
uses: actions/download-artifact@v4
- run: ls ${{ github.workspace }}/analog-osx-x64
- name: Create New Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Analog ${{ github.ref }}
draft: false
prerelease: false
- name: Upload MacOS 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: ${{ github.workspace }}/analog-osx-x64/analog-osx-x64.zip
asset_name: analog-osx-x64.zip
asset_content_type: application/zip
- name: Upload Linux 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: ${{ github.workspace }}/analog-linux-x64/analog-linux-x64.zip
asset_name: analog-linux-x64.zip
asset_content_type: application/zip
- name: Upload Windows 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: ${{ github.workspace }}/analog-win-x64/analog-win-x64.zip
asset_name: analog-win-x64.zip
asset_content_type: application/zip