From 60ecc19ded885c4d6ab99ba6c44a678aed9a0972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 1 Sep 2020 17:58:38 +0200 Subject: [PATCH 1/4] Remove unnecessary `man:` namespacing --- bundler/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundler/Rakefile b/bundler/Rakefile index 8f6a6ffe6a7d..b03d7379d911 100644 --- a/bundler/Rakefile +++ b/bundler/Rakefile @@ -124,7 +124,7 @@ namespace :man do end desc "Build the man pages" - task :build => ["man:clean", "man:build_all_pages"] + task :build => ["clean", "build_all_pages"] desc "Verify man pages are in sync" task :check => :build do From 095f20e8b94732df1f58a55624a537e520b54e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 1 Sep 2020 17:58:59 +0200 Subject: [PATCH 2/4] Prefer symbols for prerequisites For consistency. --- bundler/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundler/Rakefile b/bundler/Rakefile index b03d7379d911..c644a39f6d06 100644 --- a/bundler/Rakefile +++ b/bundler/Rakefile @@ -124,7 +124,7 @@ namespace :man do end desc "Build the man pages" - task :build => ["clean", "build_all_pages"] + task :build => [:clean, :build_all_pages] desc "Verify man pages are in sync" task :check => :build do From d5fb9f5400edfda29e88f590938c047d789a039f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 1 Sep 2020 17:59:26 +0200 Subject: [PATCH 3/4] Ignore date when checking that man pages are in sync --- bundler/Rakefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bundler/Rakefile b/bundler/Rakefile index c644a39f6d06..be9835c22193 100644 --- a/bundler/Rakefile +++ b/bundler/Rakefile @@ -93,7 +93,8 @@ namespace :man do roff = "man/#{File.basename(source, ".ronn")}" file roff => ["man", ronn] do - sh "bin/ronn --warnings --roff --pipe --date #{Time.now.strftime("%Y-%m-%d")} #{ronn} > #{roff}" + date = ENV["MAN_PAGES_DATE"] || Time.now.strftime("%Y-%m-%d") + sh "bin/ronn --warnings --roff --pipe --date #{date} #{ronn} > #{roff}" end task :build_all_pages => roff @@ -126,8 +127,14 @@ namespace :man do desc "Build the man pages" task :build => [:clean, :build_all_pages] + desc "Sets target date for building man pages to the one currently present" + task :set_current_date do + require "date" + ENV["MAN_PAGES_DATE"] = Date.parse(File.readlines("man/bundle-add.1")[3].split('"')[5]).strftime("%Y-%m-%d") + end + desc "Verify man pages are in sync" - task :check => :build do + task :check => [:set_current_date, :build] do require "open3" output, status = Open3.capture2e("git status --porcelain") From dd7472eed4b3a2e976d2f616ddd75b2a87b963d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 1 Sep 2020 18:00:06 +0200 Subject: [PATCH 4/4] Stop updating man pages every month Instead, leave the month of the last edit in there. --- .github/workflows/monthly-bundler.yml | 39 --------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/monthly-bundler.yml diff --git a/.github/workflows/monthly-bundler.yml b/.github/workflows/monthly-bundler.yml deleted file mode 100644 index d715850272ef..000000000000 --- a/.github/workflows/monthly-bundler.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: monthly-bundler - -on: - schedule: - - cron: '0 0 1 * *' - -jobs: - monthly_bundler: - name: Refresh month of man pages - runs-on: ubuntu-18.04 - if: github.repository == 'rubygems/rubygems' - steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7.1 - bundler: none - - - name: Install ronn - run: gem install ronn:'~> 0.7.3' - - - name: Update month - run: bin/rake man:build - working-directory: ./bundler - - - name: Set up git config - run: | - git config user.name "The Bundler Bot" - git config user.email "bot@bundler.io" - - - name: Commit and push the changes - run: | - git add bundler/man/* - git commit -m "Bump man pages month" - git push origin master - - timeout-minutes: 15