name: Update Branch on: push: branches: - main - test* jobs: build-runspace: runs-on: windows-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Compile project shell: pwsh run: | Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1 continue-on-error: false # Directly fail the job on error, removing the need for a separate check - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Compile Winutil if: success() create-release: needs: build-runspace runs-on: windows-latest if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v4 - name: Prepare Release Date run: | $date = (Get-Date).AddDays(1).ToString('yyyy-MM-dd') echo "CURRENT_DATE=$date" >> $GITHUB_ENV shell: pwsh - name: Create Release and Upload Asset uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.CURRENT_DATE }} name: Release ${{ env.CURRENT_DATE }} draft: false prerelease: false files: ./winutil.ps1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}