diff --git a/.github/workflows/build-publish-nuget.yml b/.github/workflows/build-publish-nuget.yml new file mode 100644 index 0000000..3f1895b --- /dev/null +++ b/.github/workflows/build-publish-nuget.yml @@ -0,0 +1,15 @@ +name: Build and Publish Nuget Package + +on: + push: + tags: + - 'v*' # Triggers the workflow on tags that start with "v" + +jobs: + build-and-publish: + uses: DevOpsVisions/common-workspace-hub/.github/workflows/reusable-publish-nuget.yml@main + with: + working-directory: ./src/lib + package-source: 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d0ccd8e..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build and Publish Nuget Package - -on: workflow_dispatch - -jobs: - build: - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - id-token: write - defaults: - run: - working-directory: ./src/lib - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Build - run: dotnet build --configuration Release - - - name: Test - run: dotnet test --configuration Release --no-build - - - name: Pack - run: dotnet pack --configuration Release --no-restore --output ./nupkg - - - name: Publish to GitHub Packages - run: dotnet nuget push ./nupkg/*.nupkg --source https://nuget.pkg.github.com/DevOpsVisions/index.json --api-key ${GITHUB_TOKEN} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}