
All checks were successful
Release / Get Version (push) Successful in 5s
Release / Build and Publish Nuget (Torch.API) (push) Successful in 2m0s
Release / Build and Publish Nuget (Torch) (push) Successful in 3m6s
Release / Build and Publish Nuget (Torch.Server) (push) Successful in 3m29s
Release / Build and Publish Package (push) Successful in 4m59s
86 lines
2.6 KiB
YAML
86 lines
2.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
|
|
env:
|
|
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: paulhatch/semantic-version@v5.3.0
|
|
with:
|
|
tag_prefix: ''
|
|
major_pattern: 'breaking:'
|
|
minor_pattern: 'feature:'
|
|
|
|
build-nuget:
|
|
name: Build and Publish Nuget
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version]
|
|
strategy:
|
|
matrix:
|
|
project: [ Torch.API, Torch, Torch.Server ]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-dotnet@v4
|
|
name: Setup dotnet
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore ${{ matrix.project }}/${{ matrix.project }}.csproj --locked-mode
|
|
|
|
- name: Pack
|
|
run: dotnet pack ${{ matrix.project }}/${{ matrix.project }}.csproj -o pack --no-restore -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}"
|
|
|
|
- name: Push
|
|
run: dotnet nuget push -s https://ng.zznty.ru/v3/index.json -k ${{ secrets.NUGET_API_KEY }} ./pack/${{ matrix.project }}.${{ needs.get-version.outputs.version }}.nupkg
|
|
|
|
build:
|
|
name: Build and Publish Package
|
|
runs-on: ubuntu-latest
|
|
needs: [get-version]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
name: Checkout
|
|
|
|
- uses: actions/setup-dotnet@v4
|
|
name: Setup dotnet
|
|
|
|
- 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 -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 |