Skip to content

Remove Bundler version specification from Gemfile.lock #1

Remove Bundler version specification from Gemfile.lock

Remove Bundler version specification from Gemfile.lock #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake
publish:
name: Publish to RubyGems
needs: test
runs-on: ubuntu-latest
environment: rubygems
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Verify tag matches gem version
run: |
GEM_VERSION=$(ruby -r ./lib/astroapi/version -e "puts Astroapi::VERSION")
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$GEM_VERSION" != "$TAG_VERSION" ]; then
echo "ERROR: Tag version ($TAG_VERSION) does not match gem version ($GEM_VERSION)"
echo "Update lib/astroapi/version.rb before tagging."
exit 1
fi
- name: Build gem
run: gem build astroapi.gemspec
- name: Publish to RubyGems
run: |
mkdir -p ~/.gem
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
gem push astroapi-*.gem
rm -f ~/.gem/credentials
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--generate-notes \
astroapi-*.gem