-
-
Notifications
You must be signed in to change notification settings - Fork 13
65 lines (61 loc) · 2.85 KB
/
dotnet-core.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
name: .NET Core Build
on:
push:
branches:
- develop
- 'features/**'
pull_request:
branches: [ master, develop ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish
run: dotnet publish TwinCatAdsTool\TwinCatAdsTool.csproj -c Release /p:AssemblyVersion=1.2.${{ github.run_number }} /p:FileVersion=1.2.${{ github.run_number }} -o out
- name: Compress
run: Compress-Archive out\TwinCatAdsTool.exe TwinCatAdsTool_v1.2.${{ github.run_number }}.zip
- name: Publish ReadyToRun
run: dotnet publish TwinCatAdsTool\TwinCatAdsTool.csproj -c Release /p:AssemblyVersion=1.2.${{ github.run_number }} /p:FileVersion=1.2.${{ github.run_number }} /p:SelfContained=true /p:PublishReadyToRun=true -o out
- name: Compress ReadyToRun
run: Compress-Archive out\TwinCatAdsTool.exe TwinCatAdsTool_ReadyToRun_v1.2.${{ github.run_number }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 1.2.${{ github.run_number }}
release_name: 1.2.${{ github.run_number }}
draft: false
prerelease: true
- name: Upload
id: upload-release-asset
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: TwinCatAdsTool_v1.2.${{ github.run_number }}.zip
asset_name: TwinCatAdsTool_v1.2.${{ github.run_number }}.zip
asset_content_type: application/zip
- name: Upload ReadyToRun
id: upload-release-asset2
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: TwinCatAdsTool_ReadyToRun_v1.2.${{ github.run_number }}.zip
asset_name: TwinCatAdsTool_ReadyToRun_v1.2.${{ github.run_number }}.zip
asset_content_type: application/zip