diff --git a/.github/workflows/rake.yml b/.github/workflows/rake.yml new file mode 100644 index 0000000..d23725f --- /dev/null +++ b/.github/workflows/rake.yml @@ -0,0 +1,24 @@ +name: rake + +on: + push: + branches: [main] + tags: [v*] + pull_request: + +jobs: + rake: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ['3.4', '4.0'] + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - run: bundle exec rake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..58cd22d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: release + +on: + workflow_dispatch: + inputs: + next_version: + required: true + default: 'skip' + repository_dispatch: + types: [do-release] + +permissions: + contents: write + id-token: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.client_payload.ref || 'main' }} + + - if: github.event_name == 'repository_dispatch' + run: git fetch --tags origin + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + bundler-cache: true + + - name: Bump version, tag, and push + if: ${{ github.event_name == 'workflow_dispatch' && inputs.next_version != 'skip' && inputs.next_version != '' }} + run: | + gem install gem-release + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + gem bump --version ${{ inputs.next_version }} --tag --push + + - name: Build gem + run: gem build jekyll-calconnect-theme.gemspec + + - name: Configure RubyGems credentials + uses: rubygems/configure-rubygems-credentials@v1 + + - name: Publish to RubyGems + run: gem push jekyll-calconnect-theme-*.gem + + - name: Wait for release to propagate + run: gem exec rubygems-await jekyll-calconnect-theme-*.gem + + - name: Dispatch release-passed event + run: | + GEM_VERSION=$(ruby -e "puts Gem::Specification.load('jekyll-calconnect-theme.gemspec').version") + gh api repos/${{ github.repository }}/dispatches \ + -f event_type=release-passed \ + -f "client_payload[ref]=refs/tags/v${GEM_VERSION}" \ + -f "client_payload[sha]=${{ github.sha }}" \ + -f "client_payload[type]=release-passed" + env: + GH_TOKEN: ${{ github.token }} diff --git a/Gemfile b/Gemfile index be173b2..09adc0f 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,6 @@ source "https://rubygems.org" +gem "rake" + gemspec diff --git a/Rakefile b/Rakefile index 7181f2c..05665d7 100644 --- a/Rakefile +++ b/Rakefile @@ -2,3 +2,5 @@ require "bundler/gem_tasks" +task default: %i[build] + diff --git a/_includes/head.html b/_includes/head.html index 4d45c9d..3d0bf2b 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -35,4 +35,17 @@ {% if jekyll.environment == 'production' and site.google_analytics %} {% include google-analytics.html %} {% endif %} + + {% if site.schema_org %} + + {% endif %} diff --git a/lib/jekyll/calconnect/theme/version.rb b/lib/jekyll/calconnect/theme/version.rb index 0105be6..fd37500 100644 --- a/lib/jekyll/calconnect/theme/version.rb +++ b/lib/jekyll/calconnect/theme/version.rb @@ -2,6 +2,6 @@ module Jekyll module CalconnectTheme - VERSION = "0.2.0" + VERSION = "0.3.0" end end