Merge pull request #6418 from EricFromCanada/apidoc-workflow
workflows: add `apidoc` workflow for rubydoc.brew.sh
This commit is contained in:
commit
e71c36ec52
10
.github/main.workflow
vendored
10
.github/main.workflow
vendored
@ -1,10 +0,0 @@
|
|||||||
workflow "Push" {
|
|
||||||
on = "push"
|
|
||||||
resolves = ["Generate rubydoc.brew.sh"]
|
|
||||||
}
|
|
||||||
|
|
||||||
action "Generate rubydoc.brew.sh" {
|
|
||||||
uses = "docker://ruby:latest"
|
|
||||||
runs = ".github/main.workflow.sh"
|
|
||||||
secrets = ["RUBYDOC_DEPLOY_KEY"]
|
|
||||||
}
|
|
||||||
36
.github/main.workflow.sh
vendored
36
.github/main.workflow.sh
vendored
@ -1,36 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# silence bundler complaining about being root
|
|
||||||
mkdir ~/.bundle
|
|
||||||
echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config
|
|
||||||
|
|
||||||
# configure git
|
|
||||||
git config --global user.name "BrewTestBot"
|
|
||||||
git config --global user.email "homebrew-test-bot@lists.sfconservancy.org"
|
|
||||||
|
|
||||||
# setup SSH
|
|
||||||
mkdir ~/.ssh
|
|
||||||
chmod 700 ~/.ssh
|
|
||||||
echo "$RUBYDOC_DEPLOY_KEY" > ~/.ssh/id_ed25519
|
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
|
||||||
git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
|
||||||
|
|
||||||
# clone rubydoc.brew.sh with SSH so we can push back
|
|
||||||
git clone git@github.com:Homebrew/rubydoc.brew.sh
|
|
||||||
cd rubydoc.brew.sh
|
|
||||||
|
|
||||||
# clone latest Homebrew/brew
|
|
||||||
git clone --depth=1 https://github.com/Homebrew/brew
|
|
||||||
|
|
||||||
# run rake to build documentation
|
|
||||||
gem install bundler
|
|
||||||
bundle install
|
|
||||||
bundle exec rake
|
|
||||||
|
|
||||||
# commit and push generated files
|
|
||||||
git add docs
|
|
||||||
git diff --exit-code HEAD -- docs && exit 0
|
|
||||||
git commit -m 'docs: update from Homebrew/brew push' docs
|
|
||||||
git push
|
|
||||||
38
.github/workflows/apidoc.yml
vendored
Normal file
38
.github/workflows/apidoc.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: Generate rubydoc.brew.sh
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
jobs:
|
||||||
|
apidoc:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: docker://ruby:latest
|
||||||
|
- uses: Homebrew/actions/git-ssh@master
|
||||||
|
with:
|
||||||
|
git_user: BrewTestBot
|
||||||
|
git_email: homebrew-test-bot@lists.sfconservancy.org
|
||||||
|
key: ${{ secrets.RUBYDOC_DEPLOY_KEY }}
|
||||||
|
- run: |
|
||||||
|
# silence bundler complaining about being root
|
||||||
|
mkdir ~/.bundle
|
||||||
|
echo 'BUNDLE_SILENCE_ROOT_WARNING: "1"' > ~/.bundle/config
|
||||||
|
|
||||||
|
# clone rubydoc.brew.sh with SSH so we can push back
|
||||||
|
git clone git@github.com:Homebrew/rubydoc.brew.sh
|
||||||
|
cd rubydoc.brew.sh
|
||||||
|
|
||||||
|
# clone latest Homebrew/brew
|
||||||
|
git clone --depth=1 https://github.com/Homebrew/brew
|
||||||
|
|
||||||
|
# run rake to build documentation
|
||||||
|
gem install bundler
|
||||||
|
bundle install
|
||||||
|
bundle exec rake
|
||||||
|
|
||||||
|
# commit and push generated files
|
||||||
|
git add docs
|
||||||
|
|
||||||
|
if ! git diff --exit-code HEAD -- docs; then
|
||||||
|
git commit -m 'docs: update from Homebrew/brew push' docs
|
||||||
|
git push
|
||||||
|
fi
|
||||||
@ -1,12 +1,12 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "formula"
|
|
||||||
require "cli/parser"
|
|
||||||
|
|
||||||
# `brew uses foo bar` returns formulae that use both foo and bar
|
# `brew uses foo bar` returns formulae that use both foo and bar
|
||||||
# If you want the union, run the command twice and concatenate the results.
|
# If you want the union, run the command twice and concatenate the results.
|
||||||
# The intersection is harder to achieve with shell tools.
|
# The intersection is harder to achieve with shell tools.
|
||||||
|
|
||||||
|
require "formula"
|
||||||
|
require "cli/parser"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user