Skip to content

Commit

Permalink
ci: Try to fix release-please publish
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Nov 7, 2024
1 parent 98875e2 commit 55e1e82
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,55 @@ jobs:
token: ${{secrets.GITHUB_TOKEN}}

# Output which releases were created
- run: echo "A release was created."
if: ${{ steps.release.outputs.releases_created }}

- name: Output release info
run: |
echo "releases_created:" ${{ steps.release.outputs.releases_created }}
echo "js--release_created:" ${{ steps.release.outputs['js--release_created'] }}
echo "momoa-js--release_created:" ${{ steps.release.outputs['momoa-js--release_created'] }}
echo "rust--release_created:" ${{ steps.release.outputs['rust--release_created'] }}
echo "momoa-rs--release_created:" ${{ steps.release.outputs['momoa-rs--release_created'] }}
- run: echo "A JavaScript release was created."
if: ${{ steps.release.outputs['momoa-js--release_created'] }}
if: ${{ steps.release.outputs['js--release_created'] }}

- run: echo "A Rust release was created."
if: ${{ steps.release.outputs['momoa-rs--release_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['momoa-js--release_created'] }}
if: ${{ steps.release.outputs['js--release_created'] }}
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci
if: ${{ steps.release.outputs['momoa-js--release_created'] }}
if: ${{ steps.release.outputs['js--release_created'] }}
working-directory: js
- run: npm publish --provenance
if: ${{ steps.release.outputs['momoa-js--release_created'] }}
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['momoa-rs--release_created'] }}
if: ${{ steps.release.outputs['rust--release_created'] }}
with:
profile: minimal
toolchain: stable
override: true
- run: "cargo publish --token $CARGO_TOKEN"
if: ${{ steps.release.outputs['momoa-rs--release_created'] }}
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['momoa-js--release_created'] }}
if: ${{ steps.release.outputs['js--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
Expand All @@ -72,7 +77,7 @@ jobs:

# 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['momoa-rs--release_created'] }}
if: ${{ steps.release.outputs['rust--release_created'] }}
env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
Expand All @@ -81,14 +86,14 @@ jobs:

# 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['momoa-js--release_created'] }}
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['momoa-rs--release_created'] }}
if: ${{ steps.release.outputs['rust--release_created'] }}
env:
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}

0 comments on commit 55e1e82

Please sign in to comment.