Sha256: 552f494bc43e2cd7e50ceb9ec11a4587c812a750e5cdeae13482746fae6f565f

Contents?: true

Size: 1.82 KB

Versions: 4

Compression:

Stored size: 1.82 KB

Contents

name: main

on:
  push:
    branches:
      - 'master'
    tags:
      - '*'
  pull_request:
    branches:
      - 'master'
    types: [opened, synchronize]

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set Up
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Test
        run: ./gradlew test

      - name: Build Gem
        run: ./gradlew gem

      - name: Set up JRuby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: jruby

      - name: Publish to GPR
        if: startsWith( github.ref, 'refs/tags/' )
        run: |
          mkdir -p $HOME/.gem
          touch $HOME/.gem/credentials
          chmod 0600 $HOME/.gem/credentials
          printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
          gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} ./pkg/*.gem
        env:
          GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
          OWNER: ${{ github.repository_owner }}

      - name: Publish to RubyGems
        if: startsWith( github.ref, 'refs/tags/' )
        run: |
          mkdir -p $HOME/.gem
          touch $HOME/.gem/credentials
          chmod 0600 $HOME/.gem/credentials
          printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
          # TODO: If it is possible to accept input in the middle of a step, then the OTP Token should be inputted instead of generated.
          gem install rotp -v 6.2.0
          OTP_TOKEN=$(echo ${OTP_SECRET} | ruby -rtime -rrotp -e "puts ROTP::TOTP.new(STDIN.read.chomp, issuer: 'rubygems.org').at(Time.now)")
          gem push --otp="${OTP_TOKEN}" ./pkg/*.gem
        env:
          GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
          OTP_SECRET: "${{secrets.RUBYGEMS_OTP_SECRET}}"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
embulk-output-kintone-0.3.3 .github/workflows/ci.yml
embulk-output-kintone-0.3.2 .github/workflows/ci.yml
embulk-output-kintone-0.3.1 .github/workflows/ci.yml
embulk-output-kintone-0.3.0 .github/workflows/ci.yml