Skip to content

Commit

Permalink
Update msbuild.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
illusion0001 committed Jul 7, 2024
1 parent 2b18dcc commit 6961b6a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ on:
- '**/*.txt'
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
env:
BUILD_CONFIGURATION: Release
BRANCH: ${{ github.ref_name }}
permissions:
contents: write
steps:
Expand Down Expand Up @@ -82,19 +79,18 @@ jobs:
echo $hash
}
- name: Upload artifact
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@main
with:
name: ${{ env.zip_name }}
path: ${{ env.BUILD_CONFIGURATION }}
- name: Create Release
if: |
github.event_name == 'workflow_dispatch' &&
github.repository == 'illusion0001/Windows-Game-Patches'
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$hashMarkdown = @'
<details>
<summary>Readme Contents (Click to Expand)</summary>
Expand All @@ -113,10 +109,18 @@ jobs:
'@ -f (Get-Content ".github\README.md" | Out-String), (Get-Content "${{ env.BUILD_CONFIGURATION }}\hashes.txt" | Out-String)
$hashMarkdown | Out-File -FilePath hash.md
Get-Content hash.md
$compress = @{
Path = "${{ env.BUILD_CONFIGURATION }}\*"
DestinationPath = "${{ env.zip_name }}.zip"
}
Compress-Archive @compress
gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md # --draft --prerelease
if ("${{ env.BRANCH }}" -ieq "main")
{
gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md
}
else
{
gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md --prerelease
}

0 comments on commit 6961b6a

Please sign in to comment.