|
| 1 | +name: Publish Package |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + dry_run: |
| 7 | + description: 'Is this a dry run. If so no package will be published.' |
| 8 | + type: boolean |
| 9 | + required: true |
| 10 | + tag: |
| 11 | + description: 'Tag for provenance. For a dry run the value does not matter.' |
| 12 | + type: string |
| 13 | + required: true |
| 14 | + |
| 15 | + workflow_call: |
| 16 | + inputs: |
| 17 | + dry_run: |
| 18 | + description: 'Is this a dry run. If so no package will be published.' |
| 19 | + type: boolean |
| 20 | + required: true |
| 21 | + tag: |
| 22 | + description: 'Tag for provenance' |
| 23 | + type: string |
| 24 | + required: true |
| 25 | + |
| 26 | +jobs: |
| 27 | + publish: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + permissions: |
| 30 | + id-token: write # Needed if using OIDC to get release secrets. |
| 31 | + contents: write # Contents and pull-requests are for release-please to make releases. |
| 32 | + pull-requests: write |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0 |
| 38 | + name: Get secrets |
| 39 | + with: |
| 40 | + aws_assume_role: ${{ vars.AWS_ROLE_ARN }} |
| 41 | + ssm_parameter_pairs: '/production/common/releasing/digicert/host = DIGICERT_HOST, |
| 42 | + /production/common/releasing/digicert/api_key = DIGICERT_API_KEY, |
| 43 | + /production/common/releasing/digicert/client_cert_file_b64 = DIGICERT_CLIENT_CERT_FILE_B64, |
| 44 | + /production/common/releasing/digicert/client_cert_password = DIGICERT_CLIENT_CERT_PASSWORD, |
| 45 | + /production/common/releasing/digicert/code_signing_cert_sha1_hash = DIGICERT_CODE_SIGNING_CERT_SHA1_HASH, |
| 46 | + /production/common/releasing/nuget/api_key = NUGET_API_KEY' |
| 47 | + s3_path_pairs: 'launchdarkly-releaser/dotnet/LaunchDarkly.EventSource.snk = LaunchDarkly.EventSource.snk' |
| 48 | + |
| 49 | + |
| 50 | + - name: Build Release |
| 51 | + uses: ./.github/actions/release-build |
| 52 | + |
| 53 | + - name: Build Documentation |
| 54 | + uses: ./.github/actions/build-docs |
| 55 | + |
| 56 | + - name: Sign DLLs |
| 57 | + uses: launchdarkly/gh-actions/actions/sign-dlls@sign-dlls-v1.0.0 |
| 58 | + with: |
| 59 | + build_configuration_path: ./src/LaunchDarkly.EventSource/bin/Release |
| 60 | + dll_name: LaunchDarkly.EventSource.Microsoft.dll |
| 61 | + |
| 62 | + - name: Publish Nupkg |
| 63 | + id: publish |
| 64 | + uses: ./.github/actions/publish |
| 65 | + with: |
| 66 | + dry_run: ${{ inputs.dry_run }} |
| 67 | + |
| 68 | + - name: Publish Documentation |
| 69 | + uses: ./.github/actions/publish-docs |
| 70 | + with: |
| 71 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + dry_run: ${{ inputs.dry_run }} |
| 73 | + |
| 74 | + provenance: |
| 75 | + permissions: |
| 76 | + actions: read |
| 77 | + id-token: write |
| 78 | + contents: write |
| 79 | + if: ${{ inputs.dry_run == 'false' }} |
| 80 | + needs: ['publish'] |
| 81 | + uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0 |
| 82 | + with: |
| 83 | + base64-subjects: "${{ needs.publish.outputs.hashes }}" |
| 84 | + upload-assets: true |
| 85 | + upload-tag-name: ${{ inputs.tag }} |
| 86 | + provenance-name: ${{ format('LaunchDarkly.EventSource-{0}_provenance.intoto.jsonl', inputs.tag) }} |
0 commit comments