Skip to content

Commit

Permalink
Merge pull request #11 from DeNA/update-publish-cli
Browse files Browse the repository at this point in the history
chore: update publish command
  • Loading branch information
get-me-power authored Feb 6, 2024
2 parents b7e63e6 + eec5429 commit 91386ce
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 97 deletions.
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

0 comments on commit 91386ce

Please sign in to comment.