Skip to content

Update gem.yml

Update gem.yml #3

Workflow file for this run

name: Cross Gem
on:
push:
branches:
- release-gem-workflow
# tags:
# - "v*"
jobs:
ci-data:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.fetch.outputs.result }}
steps:
# This compiles for all supported Ruby cross-compilation platforms.
- id: fetch
uses: oxidize-rb/actions/fetch-ci-data@main
with:
supported-ruby-platforms: |
exclude: []
cross_gems:
name: Cross compile gems
needs: ci-data
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-platform: ${{ fromJSON(needs.ci-data.outputs.result).supported-ruby-platforms }}
environment: "deploy"
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
platform: ${{ matrix.ruby-platform }}
ruby-versions: 3.0,3.1,3.2,3.3
- uses: actions/upload-artifact@v3
with:
name: cross-gem-${{ matrix.ruby-platform }}
path: pkg/
if-no-files-found: error
retention-days: 1
- name: Display structure of created files
run: ls -R pkg/
# - name: Release gem
# if: startsWith(github.ref, 'refs/tags/v')
# working-directory: pkg/
# env:
# GEM_API_KEY: ${{secrets.GEM_API_KEY}}
# run: |
# mkdir -p $HOME/.gem
# touch $HOME/.gem/credentials
# chmod 0600 $HOME/.gem/credentials
# printf -- "---\n:rubygems_api_key: ${GEM_API_KEY}\n" > $HOME/.gem/credentials
# for i in *.gem; do
# if [ -f "$i" ]
# then
# gem push "$i" || true
# fi
# done