-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.44 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
name: Build and Publish Self-Contained Assemblies
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build and release'
required: true
default: 'main'
release_version:
description: 'Release version (e.g., v1.0.0)'
required: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
- linux-x64
- linux-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: '6.x'
- name: Restore dependencies
run: dotnet restore
- name: Build and publish self-contained assembly
run: dotnet publish -c Release -r ${{ matrix.runtime }} --self-contained -p:PublishSingleFile=true -o ./publish/${{ matrix.runtime }}
- name: Create Git tag
run: |
git tag ${{ github.event.inputs.release_version }}
git push origin ${{ github.event.inputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create and upload release
uses: softprops/action-gh-release@v2
with:
files: ./publish/${{ matrix.runtime }}/**/*
tag_name: ${{ github.event.inputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}