Skip to content

ci: suport homebrew #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
contents: write
issues: write
pull-requests: write
actions: write

steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand Down Expand Up @@ -154,4 +155,3 @@ jobs:
}}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: megalinter-bot
commit_user_email: [email protected]
36 changes: 35 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
release:
runs-on: ubuntu-latest

outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_version: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
release_tag: ${{ steps.release.outputs.tag_name }}
release_sha256: ${{ steps.npm_publish.outputs.sha256 }}

steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
Expand Down Expand Up @@ -51,7 +57,35 @@ jobs:
release-type: node

- name: Publish to NPM
run: yarn publish
id: npm_publish
if: ${{ steps.release.outputs.release_created }}
run: |
yarn pack
# shellcheck disable=SC2086
echo "sha256=$(shasum -a 256 action-docs-*.tgz | cut -d ' ' -f 1)" >> $GITHUB_ENV
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

homebrew:
if: ${{ needs.release.outputs.release_created }}
name: "Bump Homebrew formula"
runs-on: ubuntu-latest
needs: release
steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: npalm/bump-homebrew-formula-action@c03eb3e9122887190a202b7dc42edba8031ed0f9
with:
# A PR will be sent to github.com/Homebrew/homebrew-core to update this formula
formula-name: action-docs
formula-path: Formula/a/action-docs.rb
tag-name: ${{ needs.release.outputs.release_tag }}
download-url: https://registry.npmjs.org/action-docs/-/action-docs-${{ needs.release.outputs.release_version }}.tgz
download-sha256: ${{ needs.release.outputs.release_sha256 }}
commit-message: |
Bump action-docs to v${{ needs.release.outputs.release_version }}
For more information see: https://github.com/npalm/action-docs/releases/tag/${{ needs.release.outputs.release_tag }}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ DISABLE_LINTERS:
- COPYPASTE_JSCPD
- JAVASCRIPT_ES

DISABLE_ERRORS_LINTERS:
- SPELL_LYCHEE
- SPELL_PROSELINT
- SPELL_CSPELL

JSON_JSONLINT_FILTER_REGEX_EXCLUDE: (tsconfig.json)

SPELL_LYCHEE_FILTER_REGEX_EXCLUDE: (CHANGELOG.md)
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ Optionally you can also add the following section to generate a usage guide, rep
<!-- action-docs-usage source="action.yml" project="<project>" version="<version>" -->
```

### Generate docs via CLI
### Install

#### npm

```bash
npm install -g action-docs
```

#### brew

```bash
brew install action-docs
```

### Generate docs via CLI

```bash
cd <your github action>

# write docs to console
Expand Down