Skip to content

Commit

Permalink
chore: Add github publish action. (#28)
Browse files Browse the repository at this point in the history
The gitignore had an entry that caused this addition to be missed.
  • Loading branch information
kinyoklion committed Mar 1, 2024
1 parent cfac437 commit 3f48713
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish
description: 'Dotnet Client SDK action that packs DLLs into unsigned Nuget package and publishes to Nuget.'
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true

runs:
using: composite
steps:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0

- name: Create Nuget Package
shell: bash
run: |
dotnet restore
dotnet pack --no-build --output nupkgs --configuration Release src/LaunchDarkly.OpenFeature.ServerProvider/LaunchDarkly.OpenFeature.ServerProvider.csproj
- name: Publish Package
if: ${{ inputs.dry_run == 'false' }}
shell: bash
run: |
for pkg in $(find ./nupkgs -name '*.nupkg' -o -name '*.snupkg'); do
echo "publishing ${pkg}"
dotnet nuget push "${pkg}" --api-key ${{ env.NUGET_API_KEY }} --source https://www.nuget.org
echo "published ${pkg}"
done
- name: Publish Package Dry-Run
if: ${{ inputs.dry_run == 'true' }}
shell: bash
run: |
for pkg in $(find ./nupkgs -name '*.nupkg' -o -name '*.snupkg'); do
echo "dry run - ${pkg}"
done
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
[Bb]in
[Oo]bj
Expand All @@ -118,6 +115,7 @@ Generated_Code #added for RIA/Silverlight projects
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
nupkgs



Expand Down

0 comments on commit 3f48713

Please sign in to comment.