-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Change order of checkout versus secret access. Remove bad git …
…ignore. Add publish action. (#27) The git ignore file prevented the publish action from being committed. The checkout was deleting the SNK.
- Loading branch information
1 parent
0015906
commit fdd5a44
Showing
3 changed files
with
52 additions
and
4 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,50 @@ | ||
name: Publish Package | ||
description: '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.' | ||
required: true | ||
outputs: | ||
hashes: | ||
description: sha256sum hashes of built artifacts | ||
value: ${{ steps.hash.outputs.hashes }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup dotnet build tools | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 9.0 | ||
|
||
- name: Create Nuget Package | ||
shell: bash | ||
run: | | ||
dotnet restore ./src/LaunchDarkly.Logging.Microsoft/LaunchDarkly.Logging.Microsoft.csproj | ||
dotnet pack --no-build --output nupkgs --configuration Release ./src/LaunchDarkly.Logging.Microsoft/LaunchDarkly.Logging.Microsoft.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: Hash nuget packages | ||
id: hash | ||
if: ${{ inputs.dry_run == 'false' }} | ||
shell: bash | ||
run: | | ||
echo "hashes=$(sha256sum ./nupkgs/*.nupkg ./nupkgs/*.snupkg | base64 -w0)" >> "$GITHUB_OUTPUT" | ||
- name: Dry Run Publish | ||
if: ${{ inputs.dry_run == 'true' }} | ||
shell: bash | ||
run: | | ||
echo "This is a dry run and packages are not being published." | ||
for pkg in $(find ./nupkgs -name '*.nupkg' -o -name '*.snupkg'); do | ||
echo "detected package ${pkg}" | ||
done |
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 |
---|---|---|
|
@@ -32,6 +32,8 @@ jobs: | |
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: launchdarkly/gh-actions/actions/[email protected] | ||
name: Get secrets | ||
with: | ||
|
@@ -44,7 +46,6 @@ jobs: | |
/production/common/releasing/nuget/api_key = NUGET_API_KEY' | ||
s3_path_pairs: 'launchdarkly-releaser/dotnet/LaunchDarkly.Logging.snk = LaunchDarkly.Logging.snk' | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build Release | ||
uses: ./.github/actions/release-build | ||
|
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