fix: standardize module naming from Bundleup to BundleUp across the c… #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Gem | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| - name: Extract version from tag | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Update version.rb | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.version }} | |
| sed -i "s/VERSION = '.*'/VERSION = '$VERSION'/" lib/bundleup/version.rb | |
| cat lib/bundleup/version.rb | |
| - name: Install dependencies | |
| run: | | |
| bundle install | |
| - name: Build gem | |
| run: | | |
| gem build bundleup-sdk.gemspec | |
| - name: Publish to RubyGems | |
| run: | | |
| mkdir -p $HOME/.gem | |
| touch $HOME/.gem/credentials | |
| chmod 0600 $HOME/.gem/credentials | |
| printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
| gem push *.gem | |
| env: | |
| GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}" | |
| - name: Commit version bump | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add lib/bundleup/version.rb | |
| git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" || echo "No changes to commit" | |
| git push origin HEAD:main || echo "Nothing to push" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: "*.gem" | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |