From 9e3edefd199fa52485a2143e4fe38e3c3bb46e0c Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Thu, 28 Mar 2024 15:05:26 +0800 Subject: [PATCH] test --- Gemfile.lock | 65 +++++++++++++++++++++++--------------- action.yml | 3 ++ entrypoint.sh | 3 +- script/init_environment.sh | 26 +++++++++++++-- 4 files changed, 67 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 152682b..9f8e3c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,19 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) colorator (1.1.0) - concurrent-ruby (1.1.9) - em-websocket (0.5.2) + concurrent-ruby (1.2.3) + em-websocket (0.5.3) eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) + http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.15.3) + ffi (1.16.3) forwardable-extended (2.6.0) gemoji (3.0.1) - http_parser.rb (0.6.0) - i18n (1.8.10) + http_parser.rb (0.8.0) + i18n (1.14.4) concurrent-ruby (~> 1.0) jekyll (4.1.1) addressable (~> 2.4) @@ -30,55 +30,68 @@ GEM rouge (~> 3.0) safe_yaml (~> 1.0) terminal-table (~> 1.8) - jekyll-feed (0.15.1) + jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) - jekyll-sass-converter (2.1.0) + jekyll-sass-converter (2.2.0) sassc (> 2.0.1, < 3.0) - jekyll-seo-tag (2.7.1) + jekyll-seo-tag (2.8.0) jekyll (>= 3.8, < 5.0) - jekyll-spaceship (0.9.9) + jekyll-spaceship (0.10.2) gemoji (~> 3.0) jekyll (>= 3.6, < 5.0) nokogiri (~> 1.6) rainbow (~> 3.0) jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (2.3.1) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.6.0) + liquid (4.0.4) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) - mini_portile2 (2.8.5) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - nokogiri (1.16.2) - mini_portile2 (~> 2.8.2) + nokogiri (1.16.3-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.3-arm-linux) + racc (~> 1.4) + nokogiri (1.16.3-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.3-x86-linux) + racc (~> 1.4) + nokogiri (1.16.3-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.3-x86_64-linux) racc (~> 1.4) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) + public_suffix (5.0.4) racc (1.7.3) - rainbow (3.0.0) - rb-fsevent (0.11.0) + rainbow (3.1.1) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - rouge (3.26.0) + rexml (3.2.6) + rouge (3.30.0) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - unicode-display_width (1.7.0) + unicode-display_width (1.8.0) PLATFORMS - ruby + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux DEPENDENCIES jekyll (~> 4.1.0) @@ -90,4 +103,4 @@ DEPENDENCIES wdm (~> 0.1.1) BUNDLED WITH - 2.2.19 + 2.5.7 diff --git a/action.yml b/action.yml index cdffc00..79d986e 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: cname: description: 'The cname to use for the site' required: false + ruby_ver: + description: 'The Ruby version' + required: false bundler_ver: description: 'The Bundler version' required: false diff --git a/entrypoint.sh b/entrypoint.sh index 352ab20..19768dc 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,7 +12,8 @@ SSH_PRIVATE_KEY=${INPUT_SSH_PRIVATE_KEY:=} ACTOR=${INPUT_ACTOR} REPOSITORY=${INPUT_REPOSITORY} BRANCH=${INPUT_BRANCH} -BUNDLER_VER=${INPUT_BUNDLER_VER:=~>2.4.0} +RUBY_VER=${INPUT_RUBY_VER:=3.0.6-1} +BUNDLER_VER=${INPUT_BUNDLER_VER:=~>2.5.0} JEKYLL_SRC=${INPUT_JEKYLL_SRC:=./} JEKYLL_CFG=${INPUT_JEKYLL_CFG:=./_config.yml} JEKYLL_BASEURL=${INPUT_JEKYLL_BASEURL:=} diff --git a/script/init_environment.sh b/script/init_environment.sh index 410a61c..e9fe463 100755 --- a/script/init_environment.sh +++ b/script/init_environment.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Generate a default secret key +# To prevent archlinux-keyring from no secret key available to sign with +pacman-key --init + # Update packages database pacman -Syu --noconfirm @@ -11,11 +15,27 @@ if [[ -n "${SSH_PRIVATE_KEY}" ]]; then pacman -S --noconfirm openssh fi + # Installing ruby libraries -pacman -S --noconfirm ruby2.7 ruby-bundler +case "${RUBY_VERSION}" in + 2.7) + pacman -S --noconfirm ruby2.7 + + # Setting default ruby version + cp /usr/bin/ruby-2.7 /usr/bin/ruby + ;; + 3*) + # https://gitlab.archlinux.org/archlinux/packaging/packages/ruby/-/tags + pacman -S --noconfirm ruby-${RUBY_VERSION} + + # Fix warning: You don't have ./ruby/3.0.0/bin in your PATH, + # gem executables will not run + export GEM_HOME="$(gem environment gemdir)" + export PATH="$PATH:$GEM_HOME/bin" + ;; +esac -# Setting default ruby version -cp /usr/bin/ruby-2.7 /usr/bin/ruby +pacman -S --noconfirm ruby-bundler # debug ruby -v && bundle version