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 diff --git a/bundler/Rakefile b/bundler/Rakefile index 8f6a6ffe6a7d..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 @@ -124,10 +125,16 @@ namespace :man do end desc "Build the man pages" - task :build => ["man:clean", "man:build_all_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")