修復預設閘道空值問題,將空值設定為0.0.0.0 #56
This file contains 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: Deploy Windows Forms App | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x # 指定 .NET 6 版本 | |
- name: Add local NuGet source | |
run: dotnet nuget add source ${{ github.workspace }}/QuickIPchange/nuget -n local | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish Windows Forms App with ClickOnce without version | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: dotnet publish -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:ClickOnceDeploymentBuild=true /p:PublishProfile="./QuickIPchange/My Project/PublishProfiles/ClickOnceProfile.pubxml" | |
- name: Get the version Tag | |
if: startsWith(github.ref, 'refs/tags/') | |
id: vars | |
run: echo ${{ github.ref_name }} | |
- name: Publish Windows Forms App with ClickOnce with version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: dotnet publish -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:ClickOnceDeploymentBuild=true /p:PublishProfile="./QuickIPchange/My Project/PublishProfiles/ClickOnceProfile.pubxml" /p:AssemblyVersion=${{ github.ref_name }} /p:Version=${{ github.ref_name }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: clickonce-artifact | |
path: ./QuickIPchange/bin/Release/net8.0-windows7.0/win-x64/publish/QuickIPchange.exe | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./QuickIPchange/bin/Release/net8.0-windows7.0/win-x64/publish/QuickIPchange.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |