|
| 1 | +name: Publish .NET SDK |
| 2 | + |
| 3 | +inputs: |
| 4 | + aws-role-arn: |
| 5 | + description: 'The AWS role ARN to assume.' |
| 6 | + type: string |
| 7 | + required: true |
| 8 | + dry-run: |
| 9 | + description: 'Is this a dry run. If so no package will be published.' |
| 10 | + type: boolean |
| 11 | + required: true |
| 12 | + |
| 13 | +outputs: |
| 14 | + package-hashes: |
| 15 | + description: 'Base64 encoded SHA256 hashes of published packages' |
| 16 | + value: ${{ steps.package-hashes.outputs.package-hashes }} |
| 17 | + |
| 18 | +runs: |
| 19 | + using: composite |
| 20 | + steps: |
| 21 | + - uses: launchdarkly/gh-actions/actions/[email protected] |
| 22 | + name: Get secrets |
| 23 | + with: |
| 24 | + aws_assume_role: ${{ inputs.aws-role-arn }} |
| 25 | + ssm_parameter_pairs: |
| 26 | + '/production/common/releasing/digicert/host = DIGICERT_HOST, |
| 27 | + /production/common/releasing/digicert/api_key = DIGICERT_API_KEY, |
| 28 | + /production/common/releasing/digicert/client_cert_file_b64 = DIGICERT_CLIENT_CERT_FILE_B64, |
| 29 | + /production/common/releasing/digicert/client_cert_password = DIGICERT_CLIENT_CERT_PASSWORD, |
| 30 | + /production/common/releasing/digicert/code_signing_cert_sha1_hash = DIGICERT_CODE_SIGNING_CERT_SHA1_HASH, |
| 31 | + /production/common/releasing/nuget/api_key = NUGET_API_KEY' |
| 32 | + s3_path_pairs: 'launchdarkly-releaser/dotnet/LaunchDarkly.snk = LaunchDarkly.snk' |
| 33 | + |
| 34 | + - name: Restore |
| 35 | + shell: bash |
| 36 | + working-directory: sdk/@launchdarkly/observability-dotnet |
| 37 | + run: dotnet restore |
| 38 | + |
| 39 | + - name: Build |
| 40 | + shell: bash |
| 41 | + working-directory: ./sdk/@launchdarkly/observability-dotnet |
| 42 | + run: dotnet build ./src/LaunchDarkly.Observability/LaunchDarkly.Observability.csproj --no-restore -p:Configuration=Release |
| 43 | + |
| 44 | + - name: Package |
| 45 | + shell: bash |
| 46 | + working-directory: ./sdk/@launchdarkly/observability-dotnet |
| 47 | + run: dotnet pack ./src/LaunchDarkly.Observability/LaunchDarkly.Observability.csproj --no-build --output nupkgs --configuration Release |
| 48 | + |
| 49 | + - name: Publish Package |
| 50 | + if: ${{ inputs.dry-run == 'false' }} |
| 51 | + shell: bash |
| 52 | + working-directory: ./sdk/@launchdarkly/observability-dotnet |
| 53 | + run: | |
| 54 | + for pkg in $(find ./nupkgs -name '*.nupkg' -o -name '*.snupkg'); do |
| 55 | + echo "publishing ${pkg}" |
| 56 | + dotnet nuget push "${pkg}" --api-key ${{ env.NUGET_API_KEY }} --source https://www.nuget.org |
| 57 | + echo "published ${pkg}" |
| 58 | + done |
| 59 | +
|
| 60 | + - name: Hash nuget packages |
| 61 | + id: package-hashes |
| 62 | + shell: bash |
| 63 | + working-directory: ./sdk/@launchdarkly/observability-dotnet |
| 64 | + run: | |
| 65 | + echo "package-hashes=$(sha256sum ./nupkgs/*.nupkg ./nupkgs/*.snupkg | base64 -w0)" >> "$GITHUB_OUTPUT" |
0 commit comments