diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 2e145347..2c2f50c4 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -7,7 +7,7 @@ on: branches: [ master ] env: - DOCKER_TAG_IMAGE: "ghcr.io/github/pages-gem" + REGISTRY: ghcr.io jobs: build: @@ -15,21 +15,29 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Get Docker Metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: - images: ${{ env.DOCKER_TAG_IMAGE }} - - - name: Build Docker Image - run: | - docker build -t ${{ steps.meta.outputs.tags }} -f Dockerfile . - - - name: Push to Container Registry - if: github.event_name != 'pull_request' - run: | - echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${{ github.actor }} https://ghcr.io --password-stdin - docker push ${{ steps.meta.outputs.tags }} + images: ${{ env.REGISTRY }}/${{ github.repository }} + - name: Build Docker Image and Push to Container Registry + uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000..1f9a37a0 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,24 @@ +name: Publish Gem + +on: + release: + types: [released] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + - name: Build gem + run: | + gem build github-pages.gemspec + - name: Publish gem + env: + GEM_HOST_API_KEY: ${{ secrets.PAGES_GEM_PUBLISH }} + run: | + gem push github-pages-*.gem diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f1948348..84143356 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,10 +7,12 @@ jobs: strategy: matrix: ruby: - - 2.6 - - 2.7 + - '3.0' + - '3.1' + - '3.2' + - '3.3' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: script/cibuild-docker run: script/cibuild-docker env: diff --git a/.rubocop.yml b/.rubocop.yml index fbcea5f9..9cbf940c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -23,7 +23,7 @@ require: - rubocop-performance AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.0 Exclude: - 'bin/**/*' - 'script/**/*' diff --git a/.ruby-version b/.ruby-version index 2c9b4ef4..eb39e538 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.3 +3.3 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1b620224..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby -rvm: - - 2.5 - - 2.6 - - 2.7 - -branches: - only: - - master - -before_install: - - gem update --system - - gem install bundler -script: "script/cibuild" -env: - global: - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true - -notifications: - email: false - -cache: bundler diff --git a/Dockerfile b/Dockerfile index 6b84ef29..3caedbfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG RUBY_VERSION=2.7.3 +ARG RUBY_VERSION=3.3 FROM ruby:$RUBY_VERSION RUN apt-get update \ @@ -8,8 +8,6 @@ RUN apt-get update \ make \ nodejs -RUN gem update --system - COPY .git /src/gh/pages-gem/.git COPY Gemfile* /src/gh/pages-gem/ COPY github-pages.gemspec /src/gh/pages-gem diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 3c572c2f..aea69e92 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,4 +1,4 @@ -FROM ruby:2.7.3-alpine +FROM ruby:3.3-alpine RUN apk update && apk add --no-cache \ git diff --git a/Gemfile b/Gemfile index 464ed458..31363899 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gemspec gem "jekyll-octicons" group :test do - gem "rubocop", "~> 0.79" + gem "rubocop", "~> 1.37" gem "rubocop-performance" gem "webmock" end diff --git a/bin/github-pages b/bin/github-pages index d91bf9d4..5ae512c9 100755 --- a/bin/github-pages +++ b/bin/github-pages @@ -43,7 +43,7 @@ Mercenary.program(:"github-pages") do |p| c.action do |args, options| require 'github-pages-health-check' cname_path = File.expand_path "CNAME", Dir.pwd - raise "No CNAME file found in current directory" unless File.exists?(cname_path) + raise "No CNAME file found in current directory" unless File.exist?(cname_path) cname = File.open(cname_path).read.strip check = GitHubPages::HealthCheck.check(cname) puts "Checking domain #{cname}..." diff --git a/github-pages.gemspec b/github-pages.gemspec index 3602f4f8..dacbb09f 100644 --- a/github-pages.gemspec +++ b/github-pages.gemspec @@ -30,5 +30,5 @@ Gem::Specification.new do |s| s.add_development_dependency("jekyll_test_plugin_malicious", "~> 0.2") s.add_development_dependency("pry", "~> 0.10") s.add_development_dependency("rspec", "~> 3.3") - s.add_development_dependency("rubocop-github", "0.16.0") + s.add_development_dependency("rubocop-github", "0.20.0") end diff --git a/lib/github-pages/dependencies.rb b/lib/github-pages/dependencies.rb index dba5cc26..5d3f948d 100644 --- a/lib/github-pages/dependencies.rb +++ b/lib/github-pages/dependencies.rb @@ -7,39 +7,39 @@ module GitHubPages class Dependencies VERSIONS = { # Jekyll - "jekyll" => "3.9.3", + "jekyll" => "3.9.5", "jekyll-sass-converter" => "1.5.2", # Converters - "kramdown" => "2.3.2", + "kramdown" => "2.4.0", "kramdown-parser-gfm" => "1.1.0", "jekyll-commonmark-ghpages" => "0.4.0", # Misc "liquid" => "4.0.4", - "rouge" => "3.26.0", - "github-pages-health-check" => "1.17.9", + "rouge" => "3.30.0", + "github-pages-health-check" => "1.18.2", # Plugins "jekyll-redirect-from" => "0.16.0", "jekyll-sitemap" => "1.4.0", - "jekyll-feed" => "0.15.1", + "jekyll-feed" => "0.17.0", "jekyll-gist" => "1.5.0", "jekyll-paginate" => "1.1.0", - "jekyll-coffeescript" => "1.1.1", + "jekyll-coffeescript" => "1.2.2", "jekyll-seo-tag" => "2.8.0", - "jekyll-github-metadata" => "2.13.0", - "jekyll-avatar" => "0.7.0", + "jekyll-github-metadata" => "2.16.1", + "jekyll-avatar" => "0.8.0", "jekyll-remote-theme" => "0.4.3", "jekyll-include-cache" => "0.2.1", # Plugins to match GitHub.com Markdown - "jemoji" => "0.12.0", + "jemoji" => "0.13.0", "jekyll-mentions" => "1.6.0", "jekyll-relative-links" => "0.6.1", "jekyll-optional-front-matter" => "0.3.2", "jekyll-readme-index" => "0.3.0", - "jekyll-default-layout" => "0.1.4", + "jekyll-default-layout" => "0.1.5", "jekyll-titles-from-headings" => "0.5.3", }.freeze diff --git a/lib/github-pages/version.rb b/lib/github-pages/version.rb index a38e8a6b..c69e2cda 100644 --- a/lib/github-pages/version.rb +++ b/lib/github-pages/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module GitHubPages - VERSION = 228 + VERSION = 231 end diff --git a/script/cibuild-docker b/script/cibuild-docker index 7a6ca87d..374ac15e 100755 --- a/script/cibuild-docker +++ b/script/cibuild-docker @@ -2,8 +2,5 @@ set -ex -# Set the ruby version in the Action definition matrix. -: "${RUBY_VERSION:="2.7.3"}" - -docker build --build-arg "RUBY_VERSION=$RUBY_VERSION" -t github-pages . +docker build -t github-pages . docker run --rm --workdir /src/gh/pages-gem github-pages script/cibuild diff --git a/spec/fixtures/jekyll-relative-links.md b/spec/fixtures/jekyll-relative-links.md index 889348d1..bebe8a23 100644 --- a/spec/fixtures/jekyll-relative-links.md +++ b/spec/fixtures/jekyll-relative-links.md @@ -1,5 +1,7 @@ --- +excerpt: Just a relative link --- - [Jekyll](jekyll.md) + +{{ page.excerpt }} \ No newline at end of file diff --git a/spec/github-pages/integration_spec.rb b/spec/github-pages/integration_spec.rb index 35740df2..d673a418 100644 --- a/spec/github-pages/integration_spec.rb +++ b/spec/github-pages/integration_spec.rb @@ -224,6 +224,7 @@ def rm_destination context "jekyll-relative-links" do it "converts relative links" do expect(contents).to match('Jekyll') + expect(contents).to match("
Just a relative link
") # excerpt end end