diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a61af79 --- /dev/null +++ b/.github/workflows/release.yml @@ -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>/$VERSION<\/AssemblyVersion>/g" Crisp.Core/Crisp.Core.csproj + sed -i "s/.*<\/FileVersion>/$VERSION<\/FileVersion>/g" Crisp.Core/Crisp.Core.csproj + sed -i "s/.*<\/AssemblyVersion>/$VERSION<\/AssemblyVersion>/g" Crisp.Ui/Crisp.Ui.csproj + sed -i "s/.*<\/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 diff --git a/src/Crisp.Core/Crisp.Core.csproj b/src/Crisp.Core/Crisp.Core.csproj index 132c70f..2a8ddad 100644 --- a/src/Crisp.Core/Crisp.Core.csproj +++ b/src/Crisp.Core/Crisp.Core.csproj @@ -4,6 +4,8 @@ net7.0 enable enable + 0.0.0 + 0.0.0 diff --git a/src/Crisp.Ui/Crisp.Ui.csproj b/src/Crisp.Ui/Crisp.Ui.csproj index 8640317..58796ee 100644 --- a/src/Crisp.Ui/Crisp.Ui.csproj +++ b/src/Crisp.Ui/Crisp.Ui.csproj @@ -11,6 +11,8 @@ https://localhost:44482 npm start enable + 0.0.0 + 0.0.0