Skip to content

Commit

Permalink
Update dotnet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CatmanFan committed Dec 28, 2024
1 parent 2efb9c4 commit 796c0b3
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [ "main" ]

permissions:
contents: write

jobs:
build:
runs-on: windows-latest
Expand All @@ -29,33 +32,28 @@ jobs:
run: nuget restore FriishProduce.sln

- name: Build release
run: MSBuild FriishProduce.sln /p:Configuration=Release /p:Platform="Any CPU" /t:build /restore /p:DeleteExistingFiles=False /p:PublishUrl="_build"
run: MSBuild FriishProduce.sln /p:Configuration=Release /p:Platform="Any CPU" /t:publish /restore /p:DeleteExistingFiles=False /p:PublishUrl="_build"

- name: Create archive
run: Compress-Archive -Path _build/* -Destination out.zip
run: Compress-Archive -Path _build/* -Destination FriishProduce_latest.zip

- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create/Update Github Release
uses: mini-bomba/create-github-release@v1.2.0
with:
tag_name: latest
release_name: Latest Build (${{ steps.date.outputs.date }})
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: "latest"
prerelease: true

- name: Upload release
id: upload_release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out.zip
asset_name: FriishProduce_latest.zip
asset_content_type: application/zip
name: "Latest Build (${{ steps.date.outputs.date }})"
body: |
This automatic prerelease is built from commit ${{ env.GIT_HASH }} and was triggered by @${{ github.actor }}
[Github Actions workflow run that built this prerelease](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})

Commit message:
${{ env.GIT_MESSAGE }}
files: |
FriishProduce_latest.zip
clear_attachments: true

0 comments on commit 796c0b3

Please sign in to comment.