on: push: tags: - 'v*' name: Build & release gem jobs: release: name: Build & release gem runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.5 bundler-cache: true - run: bundle exec bin/release-check - run: bundle exec bin/extract-changelog > release.md - run: gem build lirc.gemspec - uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: false prerelease: false body_path: release.md - name: Publish to RubyGems run: | mkdir -p "$HOME/.gem" printf -- "---\n:rubygems_api_key: $RUBYGEMS_API_KEY\n" > "$HOME/.gem/credentials" chmod 0600 "$HOME/.gem/credentials" gem push *.gem env: RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}