S2-Release #1
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: S2-Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require tag | |
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| run: | | |
| echo "::error::S2-Release must be run from a tag, not a branch." | |
| exit 1 | |
| - uses: actions/checkout@v6 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - name: Verify version matches tag | |
| run: | | |
| GEM_VERSION=$(ruby -r ./lib/jekyll-aeo/version -e "puts JekyllAeo::VERSION") | |
| TAG_VERSION="${GITHUB_REF#refs/tags/}" | |
| if [ "$GEM_VERSION" != "$TAG_VERSION" ]; then | |
| echo "::error::Tag ($TAG_VERSION) does not match gem version ($GEM_VERSION)" | |
| exit 1 | |
| fi | |
| - run: bundle exec rake | |
| - run: gem build jekyll-aeo.gemspec | |
| - run: gem push jekyll-aeo-*.gem | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} |