This repository was archived by the owner on Sep 29, 2025. It is now read-only.
Remove debug codes #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| runs-on: windows-latest | |
| env: | |
| Project_Path: AutoPowerTimeOut.csproj | |
| steps: | |
| # Checkout codes | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| # Install the .NET Core workload | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 9.0.x | |
| # Restore dependencies | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.Project_Path }} | |
| # Build the project | |
| - name: Build | |
| run: dotnet build ${{ env.Project_Path }} --configuration Release --no-restore | |
| # Get package version | |
| - name: Get Package Version | |
| run: | | |
| $version = [system.diagnostics.fileversioninfo]::getversioninfo("bin\Release\AutoPowerTimeOut.dll").fileversion | |
| echo "release_version=$version" | out-file -filepath $env:github_env -encoding utf-8 -append | |
| # Publish the project | |
| - name: Publish | |
| run: dotnet publish ${{ env.Project_Path }} -p:PublishProfile=Net9.0-Win64.pubxml | |
| # Zip the output files | |
| - name: Zip files | |
| run: | | |
| $zipName = "AutoPowerTimeOut-v${{ env.release_version }}.zip" | |
| Compress-Archive -Path "bin\Publish\*" -DestinationPath $zipName | |
| # Publish to GitHub releases | |
| - name: Publish | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: AutoPowerTimeOut*.zip | |
| tag_name: "v${{ env.release_version }}" |