Update dotnet.yml #36
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Publish | |
run: dotnet publish --runtime win-x64 --configuration Release | |
- name: 'Get current version' | |
id: releaseVersion | |
run: | | |
owner="pieckenst" | |
repo="Mass-Effect-Legendary-Launcher" | |
release_json=$(curl https://api.github.com/repos/$owner/$repo/releases) | |
Release_tag=$(echo "$release_json" | jq -r '.[0].tag_name') | |
echo "Release_tag: Latest Tag is : $Release_tag" | |
echo ::set-output name=Release_tag::"$Release_tag" | |
- name: 'Get next minor version' | |
id: bump_version_patch | |
uses: christian-draeger/[email protected] | |
with: | |
current-version: ${{ steps.releaseVersion.outputs.Release_tag }} | |
version-fragment: 'bug' | |
- name: 'Create new milestone' | |
id: createmilestone | |
uses: "WyriHaximus/github-action-create-milestone@v1" | |
with: | |
title: ${{ steps.bump_version_patch.outputs.next-version }} | |
env: | |
GITHUB_TOKEN: "${{ secrets.WORKFLOW_TOKEN }}" | |
- name: '[Windows] Archive build' | |
run: zip -r "mele-launcher-bin-win-output.zip" ./MELE-launcher/bin/Release/net5.0/win-x64 # this is kinda a hack and might not work lol | |
- name: Release | |
uses: softprops/[email protected] | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ steps.bump_version_patch.outputs.next-version }} | |
body: "Automatic CI build - for changes please see commit history" | |
files: "mele-launcher-bin-win-output.zip" | |
env: | |
GITHUB_TOKEN: "${{ secrets.WORKFLOW_TOKEN }}" | |