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 cbbe0a0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 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,30 @@ 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
- name: Update release
id: update_release
uses: tubone24/update_release@v1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
TAG_NAME: latest
with:
tag_name: latest
release_name: Latest Build (${{ steps.date.outputs.date }})
draft: true
prerelease: true

- name: Upload release
id: upload_release
- name: Upload to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out.zip
upload_url: ${{ steps.update_release.outputs.upload_url }}
asset_path: FriishProduce_latest.zip
asset_name: FriishProduce_latest.zip
asset_content_type: application/zip

0 comments on commit cbbe0a0

Please sign in to comment.