98 lines
3.7 KiB
YAML
98 lines
3.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
|
|
env:
|
|
BUILD_CONFIGURATION: Release
|
|
DOTNET_NOLOGO: true
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
|
|
jobs:
|
|
get-version:
|
|
name: Get Version
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
name: Checkout
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Git Version
|
|
id: version
|
|
uses: codacy/git-version@2.7.1
|
|
|
|
build-nuget:
|
|
name: Build and Publish Nuget
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-dotnet@v3
|
|
name: Setup dotnet
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode
|
|
|
|
- name: Build
|
|
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c ${{ env.BUILD_CONFIGURATION }} -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}"
|
|
|
|
- run: dotnet pack -c Release ./Torch.API/Torch.API.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
|
- run: dotnet pack -c Release ./Torch/Torch.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
|
- run: dotnet pack -c Release ./Torch.Server/Torch.Server.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
|
- run: mkdir blank && sed -i 's/torchVersion/${{ needs.get-version.outputs.version }}/g' Torch.Server.ReferenceAssemblies.net7.nuspec && nuget pack Torch.Server.ReferenceAssemblies.net7.nuspec -BasePath ./blank -OutputDirectory pack -NonInteractive -NoPackageAnalysis
|
|
|
|
- name: Install Sleet
|
|
run: dotnet tool install -g sleet
|
|
- name: Push Nuget Package
|
|
env:
|
|
SLEET_FEED_TYPE: s3
|
|
SLEET_FEED_PATH: https://nuget.storage.yandexcloud.net
|
|
SLEET_FEED_BUCKETNAME: nuget
|
|
SLEET_FEED_SERVICEURL: https://storage.yandexcloud.net
|
|
SLEET_FEED_ACCESSKEYID: ${{ secrets.S3_KEY_ID }}
|
|
SLEET_FEED_SECRETACCESSKEY: ${{ secrets.S3_KEY }}
|
|
run: sleet push ./pack
|
|
|
|
build:
|
|
name: Build and Publish Package
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-dotnet@v3
|
|
name: Setup dotnet
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode -r win-x64
|
|
|
|
- name: Publish
|
|
run: dotnet publish Torch.Server/Torch.Server.csproj --no-restore --sc -r win-x64 -c ${{ env.BUILD_CONFIGURATION }} -o ./publish -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}"
|
|
|
|
- uses: vimtor/action-zip@v1
|
|
name: Zip Release
|
|
with:
|
|
files: publish/
|
|
dest: torch-server.zip
|
|
|
|
- name: Create Release
|
|
uses: akkuman/gitea-release-action@v1
|
|
env:
|
|
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
with:
|
|
tag_name: ${{ needs.get-version.outputs.version }}
|
|
name: Release v${{ needs.get-version.outputs.version }}
|
|
body: ${{ steps.github_release.outputs.changelog }}
|
|
files: |-
|
|
./torch-server.zip |