diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml new file mode 100644 index 0000000..27248c5 --- /dev/null +++ b/.github/actions/publish/action.yml @@ -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 diff --git a/.gitignore b/.gitignore index a6fe1bc..fe54077 100644 --- a/.gitignore +++ b/.gitignore @@ -98,9 +98,6 @@ DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html -# Click-Once directory -publish - # Others [Bb]in [Oo]bj @@ -118,6 +115,7 @@ Generated_Code #added for RIA/Silverlight projects _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML +nupkgs