# # Copyright 2023 The Sigstore Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. on: push: tags: - 'release/ruby/v*' permissions: {} name: release Ruby Gem jobs: publish: name: Publish to RubyGems runs-on: ubuntu-latest permissions: contents: read id-token: write # needed to authenticate to Google Cloud defaults: run: working-directory: gen/pb-ruby steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.3' - name: Authenticate to Google Cloud uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 with: workload_identity_provider: projects/306323169285/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-provider service_account: protobuf-specs-releaser@sigstore-secrets.iam.gserviceaccount.com - uses: google-github-actions/get-secretmanager-secrets@bc9c54b29fdffb8a47776820a7d26e77b379d262 # v3.0.0 id: secrets with: secrets: |- rubygems_auth_token:sigstore-secrets/protobuf-specs-rubygems-auth-token - name: Build run: | gem build sigstore_protobuf_specs.gemspec - name: Publish run: | mkdir -p $HOME/.gem printf -- "---\n:rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}\n" > $HOME/.gem/credentials chmod 0600 $HOME/.gem/credentials gem push *.gem env: RUBYGEMS_AUTH_TOKEN: "${{ steps.secrets.outputs.rubygems_auth_token }}"