Skip to content

Commit

Permalink
ci: Fix ci issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BiDuang committed Nov 30, 2023
1 parent 97c5485 commit 2fdb610
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build Test
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
publish-package:
name: Publish package
name: Publish PreRelease package
runs-on: windows-latest
needs: [test-build]
if: needs.test-build.result == 'success'
Expand All @@ -29,15 +29,18 @@ jobs:
with:
dotnet-version: 8.0
- uses: actions/checkout@v4
- name: Get Current Time
id: current-time
uses: josStorer/get-[email protected]
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
format: YYYYMMDD-HHmmss
utcOffset: "+08:00"
fallback: 0.0.0
- name: Fix version tag
run: echo ::set-env name=PREVIOUS_TAG::${{ steps.previoustag.outputs.tag }}
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Build the project
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
- name: Create the package
run: dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion=beta-${{ steps.current-time.outputs.formattedTime }}-${{github.sha}}"
run: $tag="${{ steps.previoustag.outputs.tag }}".replace("v",""); dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion="$tag-(CI)${{ github.sha }}-beta" --no-build --no-restore
- name: Publish the package to NuGet.org
run: dotnet nuget push -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json "ProjBobcat/ProjBobcat/bin/Release/*.nupkg"
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build Test
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
publish-package:
name: Publish package
name: Publish Release package
runs-on: windows-latest
needs: [test-build]
if: needs.test-build.result == 'success'
Expand All @@ -31,7 +31,9 @@ jobs:
- uses: actions/checkout@v4
- name: Restore packages
run: dotnet restore ProjBobcat/ProjBobcat.sln
- name: Build the project
run: dotnet build ProjBobcat/ProjBobcat.sln -c Release --no-restore
- name: Create the package
run: dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion=${{ github.ref }}
run: $tag=${{ github.ref }}.replace("v",""); dotnet pack ProjBobcat/ProjBobcat.sln -c Release -p:PackageVersion=$tag --no-build --no-restore
- name: Publish the package to NuGet.org
run: dotnet nuget push -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json "ProjBobcat/ProjBobcat/bin/Release/*.nupkg"

0 comments on commit 2fdb610

Please sign in to comment.