Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anmalkov committed Dec 7, 2023
1 parent ad606e6 commit 8d1ed98
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
2 changes: 2 additions & 0 deletions src/Crisp.Core/Crisp.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>0.0.0</AssemblyVersion>
<FileVersion>0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Crisp.Ui/Crisp.Ui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<SpaProxyServerUrl>https://localhost:44482</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyVersion>0.0.0</AssemblyVersion>
<FileVersion>0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 8d1ed98

Please sign in to comment.