Skip to content

Commit

Permalink
build: reusing workflows in release-please workflow ✨ (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
vinayakkulkarni and antfu committed Mar 31, 2024
1 parent 92748ef commit 778c406
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
contents: write
pull-requests: write
id-token: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
html_url: ${{ steps.release.outputs.html_url }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
Expand All @@ -29,30 +33,42 @@ jobs:
{ "type": "refactor", "section": "Chores", "hidden": false },
{ "type": "test", "section": "Chores", "hidden": false }
]
publish-npm:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
if: ${{ steps.release.outputs.release_created }}
- uses: pnpm/action-setup@v2
if: ${{ steps.release.outputs.release_created }}
- run: pnpm install
if: ${{ steps.release.outputs.release_created }}
- run: pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- run: 'npx @humanwhocodes/tweet "@eslint/config-inspector ${{ steps.release.outputs.tag_name }} has been released: ${{ steps.release.outputs.html_url }}"'
if: ${{ steps.release.outputs.release_created }}
notify-twitter:
runs-on: ubuntu-latest
needs:
- release-please
- publish-npm
if: ${{ needs.release-please.outputs.release_created }}
steps:
- run: 'npx @humanwhocodes/tweet "@eslint/config-inspector ${{ needs.release-please.outputs.tag_name }} has been released: ${{ needs.release-please.outputs.html_url }}"'
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- run: 'npx @humanwhocodes/toot "@eslint/config-inspector ${{ steps.release.outputs.tag_name }} has been released: ${{ steps.release.outputs.html_url }}"'
if: ${{ steps.release.outputs.release_created }}
notify-mastodon:
runs-on: ubuntu-latest
needs:
- release-please
- publish-npm
if: ${{ needs.release-please.outputs.release_created }}
steps:
- run: 'npx @humanwhocodes/toot "@eslint/config-inspector ${{ needs.release-please.outputs.tag_name }} has been released: ${{ needs.release-please.outputs.html_url }}"'
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}

0 comments on commit 778c406

Please sign in to comment.