-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.35 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
name: Release
on:
workflow_dispatch:
push:
tags:
- v*
branches:
- main
jobs:
build_and_release:
runs-on: ubuntu-latest
env:
DOTNET_VERSION: '7.0.x'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set version from tag
run: |
TAG_NAME=$(echo $GITHUB_REF | cut -d '/' -f 3)
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
VERSION=${TAG_NAME#v}
echo "Updating project version to $VERSION"
sed -i "s/<AssemblyVersion>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<FileVersion>$VERSION<\/FileVersion>/g" Crisp.Core/Crisp.Core.csproj
sed -i "s/<AssemblyVersion>.*<\/AssemblyVersion>/<AssemblyVersion>$VERSION<\/AssemblyVersion>/g" Crisp.Ui/Crisp.Ui.csproj
sed -i "s/<FileVersion>.*<\/FileVersion>/<FileVersion>$VERSION<\/FileVersion>/g" Crisp.Ui/Crisp.Ui.csproj
working-directory: src
- name: Restore dependencies
run: dotnet restore
working-directory: src/Crisp.Core
- name: Build application
run: dotnet build --configuration Release --no-restore
working-directory: src/Crisp.Core