metanorma/metanorma-cli #315
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: release-tag | |
on: | |
repository_dispatch: | |
types: [ metanorma/metanorma-cli ] | |
jobs: | |
push-tag: | |
runs-on: ubuntu-20.04 | |
if: startsWith(github.event.client_payload.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} | |
- name: Parse metanorma-cli version | |
env: | |
METANORMA_CLI_TAG: ${{ github.event.client_payload.ref }} | |
run: | | |
echo METANORMA_CLI_VERSION=${METANORMA_CLI_TAG#*/v} >> ${GITHUB_ENV} | |
- uses: metanorma/metanorma-build-scripts/gh-rubygems-setup-action@main | |
with: | |
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7.7 | |
bundler: 2.3.22 | |
- run: gem install bundler | |
- name: Update version | |
run: | | |
bundle remove metanorma-cli | |
bundle add metanorma-cli -v ${METANORMA_CLI_VERSION} | |
bundle install --deployment | |
- name: Push commit and tag | |
run: | | |
git config --global user.name "metanorma-ci" | |
git config --global user.email "metanorma-ci@users.noreply.github.com" | |
git add Gemfile | |
git commit -m "Bump version to ${METANORMA_CLI_VERSION}" | |
git tag v${METANORMA_CLI_VERSION} | |
git push origin HEAD:${GITHUB_REF} --tags |