Sha256: aa134e3e51fb175bed5bf8543376c61a3474933d50a2fe838ac3c136df1dc2c3
Contents?: true
Size: 1.97 KB
Versions: 4
Compression:
Stored size: 1.97 KB
Contents
name: main on: workflow_dispatch: push: branches: - "master" tags: - "*" pull_request: branches: - "master" types: [opened, synchronize] permissions: contents: read packages: write 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: Code format check by Spotless run: ./gradlew spotlessCheck - 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