59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: linux-latest
|
|
steps:
|
|
- name: Configure git for redirects
|
|
run: |
|
|
git config --global http.https://git.marketally.com/.extraheader "AUTHORIZATION: basic $(echo -n 'x-access-token:${{ github.token }}' | base64 -w0)"
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '9.0.x'
|
|
|
|
- name: Get version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore GitCaddy.AI.sln
|
|
env:
|
|
NUGET_USER: ${{ github.actor }}
|
|
NUGET_TOKEN: ${{ github.token }}
|
|
|
|
- name: Build
|
|
run: dotnet build GitCaddy.AI.sln -c Release --no-restore -p:Version=${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Publish Service
|
|
run: |
|
|
dotnet publish src/GitCaddy.AI.Service/GitCaddy.AI.Service.csproj -c Release -o publish/linux-x64 -r linux-x64 --self-contained -p:Version=${{ steps.version.outputs.VERSION }}
|
|
dotnet publish src/GitCaddy.AI.Service/GitCaddy.AI.Service.csproj -c Release -o publish/win-x64 -r win-x64 --self-contained -p:Version=${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Package artifacts
|
|
run: |
|
|
cd publish
|
|
tar -czf gitcaddy-ai-${{ steps.version.outputs.VERSION }}-linux-x64.tar.gz linux-x64/
|
|
zip -r gitcaddy-ai-${{ steps.version.outputs.VERSION }}-win-x64.zip win-x64/
|
|
|
|
- name: Pack NuGet Client
|
|
run: dotnet pack src/GitCaddy.AI.Client/GitCaddy.AI.Client.csproj -c Release -o nupkg -p:Version=${{ steps.version.outputs.VERSION }}
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
publish/*.tar.gz
|
|
publish/*.zip
|
|
nupkg/*.nupkg
|
|
generate_release_notes: true
|