Skip to content

BitMono.CLI.Release.net462 #2

BitMono.CLI.Release.net462

BitMono.CLI.Release.net462 #2

name: BitMono.CLI.Release.net462
on:
create:
tags:
- "*"
jobs:
Build:
if: github.event_name == 'create' && github.event.ref_type == 'tag'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Build
run: dotnet build ./src/BitMono.CLI/BitMono.CLI.csproj /p:TargetFramework=net462 /p:BitMonoVersion=${{ github.ref_name }} /p:CreateBitMonoArtifacts=true --configuration Release
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build
path: "./src/BitMono.CLI/BitMono-v${{ github.ref_name }}-CLI-net462.zip"
if-no-files-found: error
Release:
needs: [Build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build
uses: actions/download-artifact@v4
with:
name: build
path: ./build/
- name: Create version
id: get-version
run: echo "version=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
shell: bash
- name: Check Prerelease
id: check-prerelease
run: "if ${{ contains(steps.get-version.outputs.version, '-') }}; then
echo is_prerelease=true >> $GITHUB_OUTPUT;
else
echo is_prerelease=false >> $GITHUB_OUTPUT;
fi"
shell: bash
- name: Create Release
uses: ncipollo/[email protected]
with:
name: BitMono Release v${{ steps.get-version.outputs.version }}
tag: v${{ steps.get-version.outputs.version }}
artifacts: "./build/BitMono-v${{ github.ref_name }}-CLI-net462.zip"
token: ${{ secrets.PAT }}
prerelease: ${{ steps.check-prerelease.outputs.is_prerelease }}
allowUpdates: true
generateReleaseNotes: true