Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update publish command #11

Merged
merged 4 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
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 }}
96 changes: 0 additions & 96 deletions publish

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<PackageId>Dena.CodeAnalysis.Testing</PackageId>
<PackageVersion>3.0.3</PackageVersion>
<PackageVersion>3.0.4</PackageVersion>
<Authors>Kazuma Inagaki, Koji Hasegawa, Kuniwak</Authors>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Description>Test helpers for DiagnosticAnalyzers</Description>
Expand Down
Loading