Skip to content

Publish Package

Publish Package #15

name: Publish Package
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
jobs:
build-ruby-gem:
uses: ./.github/workflows/build-gem.yml
with:
version: '3.0'
build-jruby-gem:
uses: ./.github/workflows/build-gem.yml
with:
version: 'jruby-9.4'
publish:
runs-on: ubuntu-latest
needs: [ 'build-ruby-gem', 'build-jruby-gem' ]
outputs:
gem-hash: ${{ steps.publish.outputs.gem-hash }}
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
version: '3.0'
install-dependencies: false
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get rubygems API key'
if: ${{ !inputs.dry_run }}
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/rubygems/api_key = GEM_HOST_API_KEY'
- uses: ./.github/actions/build-docs
- uses: ./.github/actions/publish
id: publish
with:
dry_run: ${{ inputs.dry_run }}
- uses: ./.github/actions/publish-docs
if: ${{ !inputs.dry_run }}
with:
token: ${{secrets.GITHUB_TOKEN}}
release-provenance:
needs: [ 'publish' ]
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.publish.outputs.gem-hash }}"
upload-assets: ${{ !inputs.dry_run }}