Skip to content

docs: updated readme, version bump #4

docs: updated readme, version bump

docs: updated readme, version bump #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
packages: write
jobs:
test:
uses: ./.github/workflows/test.yml
rubocop:
uses: ./.github/workflows/rubocop.yml
build-and-publish:
needs: [test, rubocop]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Get version from tag
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build gem
run: gem build challenge.gemspec
- name: Configure GitHub Packages credentials
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish to GitHub Packages
run: |
gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} challenge-*.gem
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
## Changes
See the [CHANGELOG](https://github.com/tob1k/challenge/blob/main/CHANGELOG.md) for details.
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./challenge-${{ steps.get_version.outputs.version }}.gem
asset_name: challenge-${{ steps.get_version.outputs.version }}.gem
asset_content_type: application/octet-stream