name: release on: workflow_dispatch: inputs: next_version: description: | Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc required: true default: 'patch' push: tags: [ v* ] jobs: pack: runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: host: [ linux, windows, darwin ] steps: - uses: actions/checkout@v2 with: submodules: recursive - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' bundler-cache: true - if: ${{ github.event_name == 'workflow_dispatch' }} run: | git config user.name github-actions git config user.email github-actions@github.com gem bump --version ${{ github.event.inputs.next_version }} --tag --push # build gem WITHOUT pre-built native extension - run: gem build expressir.gemspec - if: matrix.host == 'linux' uses: actions/upload-artifact@v2 with: name: pkg-ruby path: expressir-*.gem # build gem WITH pre-built native extension - run: bundle exec rake gem:${{ matrix.host }} - uses: actions/upload-artifact@v2 with: name: pkg-${{ matrix.host }} path: pkg/*.gem publish: runs-on: ubuntu-18.04 needs: pack steps: - uses: actions/download-artifact@v2 with: name: pkg-ruby path: pkg - uses: actions/download-artifact@v2 with: name: pkg-linux path: pkg - uses: actions/download-artifact@v2 with: name: pkg-windows path: pkg - uses: actions/download-artifact@v2 with: name: pkg-darwin path: pkg - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' - run: ls -l pkg/ - name: Publish to rubygems.org env: RUBYGEMS_API_KEY: ${{ secrets.LUTAML_CI_RUBYGEMS_API_KEY }} run: | mkdir -p ~/.gem cat > ~/.gem/credentials << EOF --- :rubygems_api_key: ${RUBYGEMS_API_KEY} EOF chmod 0600 ~/.gem/credentials gem signin for gem in pkg/*.gem; do gem push $gem -V; done