Skip to content

Commit

Permalink
Test new version get
Browse files Browse the repository at this point in the history
  • Loading branch information
tekgator committed May 29, 2023
1 parent 84019db commit 0b3869c
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*"

env:
SOLUTION_PATH: MinecraftJars.sln
PROJECT_PATH: MinecraftJars/MinecraftJars.csproj
PACKAGE_OUTPUT_DIR: ${{ github.workspace }}/output
NUGET_SOURCE_URL: "https://api.nuget.org/v3/index.json"

Expand All @@ -24,23 +24,29 @@ jobs:
dotnet-version: "7.0.x"

- name: "Restore packages"
run: dotnet restore ${{ env.SOLUTION_PATH }}
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: "Build project"
run: dotnet build ${{ env.SOLUTION_PATH }} --no-restore --configuration Release
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release

- name: "Get version"
id: version
uses: battila7/get-version-action@v2
run: |
TAG=${{github.ref_name}}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
# - name: "Get version"
# id: version
# uses: battila7/get-version-action@v2

- name: "Pack project"
run: dotnet pack ${{ env.SOLUTION_PATH }} --no-restore --configuration Release --p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIR }}
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --configuration Release --p:PackageVersion=${{ steps.version.outputs.version }} --output ${{ env.PACKAGE_OUTPUT_DIR }}

- name: "Push package"
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg --api-key ${{ secrets.NUGET_AUTH_TOKEN }} --source ${{ env.NUGET_SOURCE_URL }}
# - name: "Push package"
# run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg --api-key ${{ secrets.NUGET_AUTH_TOKEN }} --source ${{ env.NUGET_SOURCE_URL }}

- name: "Attach Nuget to release"
uses: AButler/upload-release-assets@v2.0
with:
files: '${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg'
repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: "Attach Nuget to release"
# uses: AButler/upload-release-assets@v2.0
# with:
# files: '${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg'
# repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0b3869c

Please sign in to comment.