diff --git a/.github/workflows/nuget-v1-legacy.yml b/.github/workflows/nuget-v1-legacy.yml index 8345032..93d851c 100644 --- a/.github/workflows/nuget-v1-legacy.yml +++ b/.github/workflows/nuget-v1-legacy.yml @@ -2,11 +2,14 @@ name: Build and Publish V1 Legacy on: push: - branches: - - V1-legacy tags: - 'v1.*' workflow_dispatch: + inputs: + ref: + description: 'Branch or tag to build (default: V1-legacy)' + required: false + default: 'V1-legacy' jobs: build-and-publish: @@ -17,6 +20,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }} - name: Setup .NET Framework uses: microsoft/setup-msbuild@v2 @@ -25,10 +30,10 @@ jobs: uses: nuget/setup-nuget@v2 - name: Restore NuGet packages - run: nuget restore src\J2534-Sharp.csproj + run: nuget restore J2534-Sharp.sln - name: Build solution - run: msbuild src\J2534-Sharp.csproj /p:Configuration=Release /p:Platform=AnyCPU + run: msbuild J2534-Sharp.sln /p:Configuration=Release /p:Platform=AnyCPU - name: Determine version id: version @@ -44,7 +49,7 @@ jobs: echo "VERSION=$version" >> $env:GITHUB_OUTPUT - name: Pack NuGet package - run: nuget pack J2534-Sharp.nuspec -Version ${{ steps.version.outputs.VERSION }} -Properties configuration=Release -BasePath Src + run: nuget pack J2534-Sharp.nuspec -Version ${{ steps.version.outputs.VERSION }} -Properties configuration=Release - name: Publish to NuGet.org if: startsWith(github.ref, 'refs/tags/v1.')