DotRecastNetSim/.github/workflows/release.yml

66 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2023-09-23 08:02:45 +03:00
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
2023-11-21 17:53:18 +03:00
uses: actions/checkout@v4
2023-10-03 09:42:01 +03:00
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
2023-09-23 08:02:45 +03:00
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
2023-09-23 08:02:45 +03:00
with:
2023-11-16 08:05:19 +03:00
dotnet-version: '8.x'
2023-09-23 08:02:45 +03:00
- name: restore dependencies
run: dotnet restore
- name: build
run: dotnet build -c Release --no-restore
- name: publish
2023-11-16 08:05:19 +03:00
run: dotnet publish src/DotRecast.Recast.Demo -c Release --framework net8.0 --no-restore --no-self-contained --output working-temp
2023-09-23 08:02:45 +03:00
- name: version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag}
major=${version%%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
- name: Zip
working-directory: ${{ env.working-directory }}
run: |
2023-09-23 08:43:40 +03:00
cp -rfv resources working-temp
2023-09-23 08:02:45 +03:00
cd working-temp
echo "dotnet DotRecast.Recast.Demo.dll" > run.bat
zip -r ../DotRecast.Recast.Demo-${{ steps.version.outputs.version}}.zip ./
if: success()
- uses: release-drafter/release-drafter@master
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: zip Upload
uses: softprops/action-gh-release@v1
with:
files: |
2023-09-23 08:43:40 +03:00
DotRecast.Recast.Demo-${{ steps.version.outputs.version}}.zip
2023-09-23 08:02:45 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}