add body to release #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-and-release: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Add NuGet source | |
env: | |
NUGET_USERNAME: ${{ secrets.USER_NAME }} | |
NUGET_PASSWORD: ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} | |
run: | | |
echo "<configuration>" > nuget.config | |
echo "<packageSources>" >> nuget.config | |
echo '<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />' >> nuget.config | |
echo '<add key="asv" value="https://nuget.pkg.github.com/asv-soft/index.json" />' >> nuget.config | |
echo "</packageSources>" >> nuget.config | |
echo "<packageSourceCredentials>" >> nuget.config | |
echo "<asv>" >> nuget.config | |
echo '<add key="Username" value="'${{ secrets.USER_NAME }}'" />' >> nuget.config | |
echo '<add key="ClearTextPassword" value="'${{ secrets.GIHUB_NUGET_AUTH_TOKEN }}'" />' >> nuget.config | |
echo "</asv>" >> nuget.config | |
echo "</packageSourceCredentials>" >> nuget.config | |
echo "</configuration>" >> nuget.config | |
- name: Install dependencies | |
run: | | |
dotnet restore ./src/Asv.Drones.Gui.Api/Asv.Drones.Gui.Api.csproj | |
dotnet restore ./src/Asv.Drones.Gui/Asv.Drones.Gui.csproj | |
dotnet restore ./src/Asv.Drones.Gui.Desktop/Asv.Drones.Gui.Desktop.csproj | |
- name: Build | |
run: | | |
dotnet build ./src/Asv.Drones.Gui.Api/Asv.Drones.Gui.Api.csproj --configuration Release --no-restore | |
dotnet build ./src/Asv.Drones.Gui/Asv.Drones.Gui.csproj --configuration Release --no-restore | |
dotnet build ./src/Asv.Drones.Gui.Desktop/Asv.Drones.Gui.Desktop.csproj --configuration Release --no-restore | |
- name: Set version variable | |
env: | |
TAG: ${{ github.ref_name }} | |
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV | |
# here you must define path to your .csproj | |
- name: Publish project for installer | |
run: dotnet publish ./src/Asv.Drones.Gui.Desktop/Asv.Drones.Gui.Desktop.csproj -c Release -o ./publish/app | |
- name: Install NSIS | |
run: | | |
choco install nsis | |
#here you must define path to your .nsi file (it is used for installer setup and creation) | |
- name: Create EXE installer | |
run: makensis ./win-64-install.nsi | |
- name: List output files | |
run: Get-ChildItem -Path ./publish/app -Force | |
- name: Get contributors | |
run: | |
git shortlog -sn --no-merges | |
- name: Create release notes | |
run: | |
echo "## Last 10 commits:" | |
git log -n 10 --format="%s (%h) %ad" --date=short | |
echo "" | |
echo "## Contributors:" | |
git shortlog -sn --no-merges | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: ${{ contains(github.ref, 'alpha') }} | |
body: ${{ steps.create-release-notes.outputs.release-notes }} | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIHUB_NUGET_AUTH_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./AsvDronesGuiInstaller.exe | |
asset_name: asv-drones-${{ github.ref }}-setup-windows-64.exe | |
asset_content_type: application/vnd.microsoft.portable-executable |