Skip to content

fix: Drop dotenv package and use native process.loadEnvFile (#152) #135

fix: Drop dotenv package and use native process.loadEnvFile (#152)

fix: Drop dotenv package and use native process.loadEnvFile (#152) #135

on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
models: read
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
# The logic below handles the npm publication:
- uses: actions/checkout@v5
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v6
with:
node-version: lts/*
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- name: Publish to npm
run: npm publish
if: ${{ steps.release.outputs.release_created }}
- name: Publish to JSR
run: |
npm run build
npx jsr publish
if: ${{ steps.release.outputs.release_created }}
# Generates the social media post
- run: npx @humanwhocodes/social-changelog --org humanwhocodes --repo crosspost --name Crosspost --tag ${{ steps.release.outputs.tag_name }} > social-post.txt
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Tweets out release announcement
- run: node dist/bin.js -t -b -m -l --file social-post.txt
if: ${{ steps.release.outputs.release_created }}
env:
TWITTER_API_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_API_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
BLUESKY_HOST: ${{ vars.BLUESKY_HOST }}
BLUESKY_IDENTIFIER: ${{ vars.BLUESKY_IDENTIFIER }}
BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }}
LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}