Automatic version update #6
This file contains 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: Build and Release Vendored Gemfile | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.5 | |
bundler-cache: true | |
- name: Bundle and install dependencies | |
run: bundle install --path=vendor/bundle | |
- name: Build distribution | |
run: gem build ruby_ast_gen.gemspec | |
- name: Get next release version (dry run) | |
id: taggerDryRun | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DRY_RUN: true | |
- name: Show next version | |
env: | |
CURR_TAG: ${{ steps.taggerDryRun.outputs.tag }}" | |
NEW_TAG: ${{ steps.taggerDryRun.outputs.new_tag }} | |
run: | | |
echo "The next tag version will be: $NEW_TAG" | |
echo "The current tag is: $CURR_TAG" | |
- name: Add and commit updated VERSION file | |
env: | |
NEW_TAG: ${{ steps.taggerDryRun.outputs.new_tag }} | |
run: | | |
./update_version.rb $NEW_TAG | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
git add lib/ruby_ast_gen/version.rb | |
git commit -m "Update VERSION file to $NEW_TAG" | |
git push | |
- name: Upload vendored distribution to GitHub Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN_PERMISSIONS: "read:packages, write:packages" | |
with: | |
tag_name: ${{ steps.taggerDryRun.outputs.new_tag }} | |
files: ruby_ast_gen-*.gem |