-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from DeNA/update-publish-cli
chore: update publish command
- Loading branch information
Showing
3 changed files
with
44 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'src/Dena.CodeAnalysis.Testing/Dena.CodeAnalysis.Testing.csproj' | ||
|
||
jobs: | ||
check-bump-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new-version: ${{ steps.diff.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 200 | ||
- name: Get version from csproj | ||
run: | | ||
version="$(grep -o --color=never "<PackageVersion>[0-9]\+\.[0-9]\+\.[0-9]\+" src/Dena.CodeAnalysis.Testing/Dena.CodeAnalysis.Testing.csproj | sed 's/<PackageVersion>//')" | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
id: diff | ||
|
||
publish: | ||
needs: check-bump-version | ||
if: ${{ needs.check-bump-version.outputs.new-version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@main | ||
with: | ||
dotnet-version: '5.0.x' | ||
|
||
- name: dotnet build | ||
run: dotnet build ./Dena.CodeAnalysis.Testing.sln --configuration Release | ||
|
||
- name: Create NuPkg | ||
run: dotnet pack ./src/Dena.CodeAnalysis.Testing --include-symbols --configuration Release -o ./nupkg | ||
|
||
- name: Publish NuPkg | ||
run: dotnet nuget push ./nupkg/Dena.CodeAnalysis.Testing.*.symbols.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters