diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 0000000..eeb8972 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,14 @@ +name: Publish Gem Package +on: + push: + branches: + - main + paths: + - 'lib/textris/version.rb' +jobs: + gem_publish: + uses: holmanauto/ci-workflows/.github/workflows/gem-package-publish.yml@main + secrets: inherit + with: + gem-name: textris + npm-scope: ${{ vars.NPM_SCOPE }} diff --git a/.github/workflows/rc-publish-gem.yml b/.github/workflows/rc-publish-gem.yml new file mode 100644 index 0000000..688d808 --- /dev/null +++ b/.github/workflows/rc-publish-gem.yml @@ -0,0 +1,34 @@ +name: Publish Release Candidate Gem Package + +on: + # Trigger the workflow on any tag push + push: + tags: + - '*' + +jobs: + extract_version: + runs-on: ubuntu-latest + outputs: + gem_version: ${{ steps.extract_version.outputs.gem_version }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Extract version from tag + id: extract_version + run: | + GEM_VERSION=$(grep '^[[:space:]]*textris (' Gemfile.lock | awk '{print $2}' | tr -d '()') + echo "gem_version=$GEM_VERSION" >> $GITHUB_OUTPUT + if [ "${{ github.ref_name }}" != $GEM_VERSION ]; then + echo "Your tag ${{ github.ref_name }} does not match the gem version $GEM_VERSION" + exit 1 + fi + gem_publish: + needs: extract_version + if: endsWith(github.ref, '-rc') + uses: holmanauto/ci-workflows/.github/workflows/gem-package-publish.yml@main + secrets: inherit + with: + gem-name: textris + npm-scope: ${{ vars.NPM_SCOPE }} + asset-build-command: echo "No assets to build for this gem" diff --git a/lib/textris/version.rb b/lib/textris/version.rb index 9526c28..a8fa597 100644 --- a/lib/textris/version.rb +++ b/lib/textris/version.rb @@ -1,3 +1,3 @@ module Textris - VERSION = '0.7.0' + VERSION = '0.7.0.rc' end