Ryujinx.CustomTasks/.github/workflows/publish-nuget.yml
dependabot[bot] 6678499785
ci: bump actions/checkout from 3 to 4 (#10)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-20 12:51:20 +02:00

53 lines
1.3 KiB
YAML

name: Publish Nuget package
on:
push:
branches:
- master
paths-ignore:
- ".gitignore"
- ".editorconfig"
- ".gitattributes"
- ".github/**"
- "*.md"
workflow_dispatch:
concurrency: publish
jobs:
publish:
runs-on: ubuntu-latest
env:
BASE_VERSION: "1.0"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Get short sha
id: git_short_sha
run: |
echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
- name: Get version info
id: version_info
run: |
[[ "${{ github.ref_name }}" == "master" ]] \
&& echo "build_version=${{ env.BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT \
|| echo "build_version=${{ env.BASE_VERSION }}.${{ github.run_number }}-${{ steps.git_short_sha.outputs.result }}" >> $GITHUB_OUTPUT
- name: Package project
run: |
dotnet pack -c Release --property:Version="${{ steps.version_info.outputs.build_version }}"
- name: Publish Nuget package
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push ./*/bin/Release/*.nupkg -k "$NUGET_AUTH_TOKEN" -s https://api.nuget.org/v3/index.json