Sha256: 524f5fb926f8a298e336b22529f2c90d2f1075df2bc79653f5ece199351e4708

Contents?: true

Size: 1.57 KB

Versions: 4

Compression:

Stored size: 1.57 KB

Contents

name: Release Gem

on:
  push:
    branches:
      - main
    paths:
      - '.github/workflows/release-gem.yml'
      - 'lib/net/http/structured_field_values/version.rb'

jobs:
  check:
    outputs:
      source_version: ${{ steps.versions.outputs.source_version }}
      gem_version: ${{ steps.versions.outputs.gem_version }}

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: .ruby-version

      - name: Set versions
        id: versions
        run: |
          echo "source_version=$(.github/workflows/print-version.rb source)" >> "$GITHUB_OUTPUT"
          echo "gem_version=$(.github/workflows/print-version.rb gem)" >> "$GITHUB_OUTPUT"

  release:
    needs: check
    if: ${{ needs.check.outputs.source_version != needs.check.outputs.gem_version }}

    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v4

      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: .ruby-version
          bundler-cache: true

      - name: Release gem
        run: |
          sudo apt-get update
          sudo apt-get install -y oathtool
          git config --global user.name "github-actions[bot]"
          git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
          GEM_HOST_OTP_CODE=$(oathtool --totp -d 6 -b ${{ secrets.RUBYGEMS_OTP_SECRET }})\
            bundle exec rake release
        env:
          GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
net-http-structured_field_values-0.3.1 .github/workflows/release-gem.yml
net-http-structured_field_values-0.3.0 .github/workflows/release-gem.yml
net-http-structured_field_values-0.2.0 .github/workflows/release-gem.yml
net-http-structured_field_values-0.1.2 .github/workflows/release-gem.yml