chore: release main (#124) #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
name: release-please | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{secrets.GITHUB_TOKEN}} | |
# Output which releases were created | |
- run: echo "A release was created." | |
if: ${{ steps.release.outputs.releases_created }} | |
- run: echo "A JavaScript release was created." | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
- run: echo "A Rust release was created." | |
if: ${{ steps.release.outputs['rust--release_created'] }} | |
# Check to see if we need to do any releases and if so check out the repo | |
- uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.releases_created }} | |
# Node.js release | |
- uses: actions/setup-node@v4 | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
working-directory: js | |
- run: npm publish | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
working-directory: js | |
# Rust release | |
- uses: actions-rs/toolchain@v1 | |
if: ${{ steps.release.outputs['rust--release_created'] }} | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: "cargo publish --token $CARGO_TOKEN" | |
if: ${{ steps.release.outputs['rust--release_created'] }} | |
working-directory: rust | |
env: | |
CARGO_TOKEN: ${{secrets.CARGO_TOKEN}} | |
# Tweets out JS release announcement | |
- run: npx @humanwhocodes/tweet "Momoa (JS) v${{ steps.release.outputs['js--major'] }}.${{ steps.release.outputs['js--minor'] }}.${{ steps.release.outputs['js--patch'] }} has been released!\n\nhttps://github.com/humanwhocodes/momoa/releases/tag/${{ steps.release.outputs['js--tag_name'] }}" | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
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 }} | |
# Tweets out Rust release announcement | |
- run: npx @humanwhocodes/tweet "Momoa (Rust) v${{ steps.release.outputs['rust--major'] }}.${{ steps.release.outputs['rust--minor'] }}.${{ steps.release.outputs['rust--patch'] }} has been released!\n\nhttps://github.com/humanwhocodes/momoa/releases/tag/${{ steps.release.outputs['rust--tag_name'] }}" | |
if: ${{ steps.release.outputs['rust--release_created'] }} | |
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 }} | |
# Toots out JS release announcement | |
- run: npx @humanwhocodes/toot "Momoa (JS) v${{ steps.release.outputs['js--major'] }}.${{ steps.release.outputs['js--minor'] }}.${{ steps.release.outputs['js--patch'] }} has been released!\n\nhttps://github.com/humanwhocodes/momoa/releases/tag/${{ steps.release.outputs['js--tag_name'] }}" | |
if: ${{ steps.release.outputs['js--release_created'] }} | |
env: | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
MASTODON_HOST: ${{ secrets.MASTODON_HOST }} | |
# Toots out Rust release announcement | |
- run: npx @humanwhocodes/toot "Momoa (Rust) v${{ steps.release.outputs['rust--major'] }}.${{ steps.release.outputs['rust--minor'] }}.${{ steps.release.outputs['rust--patch'] }} has been released!\n\nhttps://github.com/humanwhocodes/momoa/releases/tag/${{ steps.release.outputs['rust--tag_name'] }}" | |
if: ${{ steps.release.outputs['rust--release_created'] }} | |
env: | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
MASTODON_HOST: ${{ secrets.MASTODON_HOST }} |