Update dotnet.yml #29
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 previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 0.3.0 # Optional fallback tag to use when no tag can be found | |
#▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲# | |
- name: Get seconds from previous tag to now | |
id: diff | |
shell: bash | |
env: | |
TIMESTAMP_TAG: ${{ steps.previoustag.outputs.timestamp }} | |
run: | | |
echo "::set-output name=timestamp-diff::$(expr $(printf '%(%s)T') - $TIMESTAMP_TAG)" | |
- name: 'Get next minor version' | |
id: semvers | |
uses: "WyriHaximus/github-action-next-semvers@v1" | |
with: | |
version: ${{ steps.previoustag.outputs.tag }} | |
- name: 'Create new milestone' | |
id: createmilestone | |
uses: "WyriHaximus/github-action-create-milestone@v1" | |
with: | |
title: ${{ steps.semvers.outputs.patch }} | |
env: | |
GITHUB_TOKEN: "${{ secrets.WORKFLOW_TOKEN }}" | |
- name: Zip the Build | |
run: zip -r "mele-launcher-bin-win-output.zip" ./MELE-launcher/bin/Release/net5.0/win-x64/publish # this is kinda a hack and might not work lol | |
- name: Release | |
uses: softprops/action-gh-release@v0.1.14 | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ steps.semvers.outputs.patch }} | |
files: "mele-launcher-bin-win.zip" | |
env: | |
GITHUB_TOKEN: "${{ secrets.WORKFLOW_TOKEN }}" | |