From f7c5688d3787e8d03498e7de5c42977b638b1e54 Mon Sep 17 00:00:00 2001 From: anejolov <118720241+anejolov@users.noreply.github.com> Date: Thu, 13 Mar 2025 12:45:38 +0200 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35700be..769457f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build SFX EXE on Push +name: Auto Release on Push to Main on: push: @@ -6,7 +6,7 @@ on: - main jobs: - build: + release: runs-on: windows-latest steps: @@ -18,8 +18,8 @@ jobs: choco install winrar -y shell: powershell - - name: Get Release Version - run: echo "RELEASE_VERSION=latest" >> $GITHUB_ENV + - name: Get Commit SHA + run: echo "COMMIT_SHA=${{ github.sha }}" >> $GITHUB_ENV shell: bash - name: Create SFX archive @@ -35,7 +35,7 @@ jobs: "@ Set-Content -Path "sfx_config.txt" -Value $SFXConfig - $exeName = "WindeckHelper_${{ github.sha }}.exe" + $exeName = "WindeckHelper_${{ env.COMMIT_SHA }}.exe" & "C:\Program Files\WinRAR\WinRAR.exe" a -r -sfx -z"sfx_config.txt" $exeName * echo "EXE_NAME=$exeName" >> $GITHUB_ENV @@ -52,10 +52,17 @@ jobs: } shell: powershell + - name: Create GitHub Release + id: create_release + run: | + gh release create ${{ env.COMMIT_SHA }} ${{ env.EXE_NAME }} --title "Release ${{ env.COMMIT_SHA }}" --notes "Automated release generated from commit ${{ env.COMMIT_SHA }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload EXE to Release Assets uses: softprops/action-gh-release@v2 with: files: ${{ env.EXE_NAME }} - tag_name: ${{ github.sha }} + tag_name: ${{ env.COMMIT_SHA }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}