-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (72 loc) · 2.03 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
name: Release
env:
sln-path: "./src/xtb.xapi.sln"
build-dir: "build"
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet-version: [ '9.0.x' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .Net ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: .Net info
run: dotnet --info
- name: Restore dependencies
run: dotnet restore "${{ env.sln-path }}"
- name: Build release
run: dotnet build "${{ env.sln-path }}" --no-restore -c Release -o "${{ env.build-dir }}"
- name: Test
if: matrix.dotnet-version == '9.0.x'
run: dotnet test "${{ env.sln-path }}" --no-build --logger "trx;LogFileName=test-results.trx" || true
- name: Upload artifact - binaries
if: matrix.dotnet-version == '9.0.x'
uses: actions/upload-artifact@v4
with:
name: binaries
path: "${{ env.build-dir }}"
retention-days: 90
release:
name: Create Release
runs-on: ubuntu-latest
needs: [ build ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: binaries
path: "${{ env.build-dir }}"
- name: Zip binaries
uses: vimtor/action-zip@v1
with:
files: "${{ env.build-dir }}"
dest: binaries.zip
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
prerelease: false
draft: false
generate_release_notes: true
files: binaries.zip
token: ${{ secrets.GITHUB_PACKAGE_PUSH_PAT }}