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 0376571 commit 0e1b03e
Showing 1 changed file with 12 additions and 41 deletions.
53 changes: 12 additions & 41 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,16 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup MSBuild v1.1
uses: microsoft/setup-msbuild@v1.1

- name: Setup NuGet v2
uses: NuGet/setup-nuget@v2

- name: Restore packages
run: nuget restore FriishProduce.sln

- name: Build solution
run: msbuild FriishProduce\FriishProduce.csproj -t:rebuild -property:Configuration=Release

- name: Get current date
run: |
$DATE=& Get-Date -format yyyy-MM-dd
echo "DATE=$DATE" >> $env:GITHUB_ENV
- name: Get commit hash
id: commit
uses: prompt/actions-commit-hash@v3

- name: Compress archive
run: Compress-Archive -Path FriishProduce\bin\Release\* -DestinationPath FriishProduce_latest.zip

- name: Update release
id: update_release
uses: tubone24/update_release@v1.3.1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
TAG_NAME: latest
with:
release_name: "Latest build (${{ steps.commit.outputs.short }})"
body: "This is the latest build as of ${{ env.DATE }}, autogenerated from the most recent commit.\n\n**How to update manually:**\nreplace the files in your FriishProduce directory with the newer ones, and delete any leftover files or folders that are no longer needed."
is_append_body: false

- name: Upload to release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
files: FriishProduce_latest.zip
token: ${{ secrets.github_token }} # Required
- name: Setup Environment (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo "LAST_COMMIT_SHA=${{ github.event.pull_request.head.sha }}" >> ${GITHUB_ENV}
- name: Setup Environment (Push)
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV}
- name: Test
run: echo "github sha is ${{ env.LAST_COMMIT_SHA }}"

0 comments on commit 0e1b03e

Please sign in to comment.