Publish #4
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
name: Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
PublishPackage: | |
name: Publish @favware/cliff-jumper | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: master | |
- name: Use Node.js v20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Install Dependencies | |
run: yarn --immutable | |
- name: Bump Versions & Publish | |
env: | |
GITHUB_USER: github-actions[bot] | |
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | |
run: | | |
REMOTE_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git" | |
git config --local user.email "${GITHUB_EMAIL}" | |
git config --local user.name "${GITHUB_USER}" | |
git branch --set-upstream-to=origin/${REMOTE_BRANCH} ${REMOTE_BRANCH} | |
yarn bump | |
- name: Publish to NPM | |
run: | | |
yarn config set npmAuthToken ${NODE_AUTH_TOKEN} | |
yarn config set npmPublishRegistry "https://registry.yarnpkg.com" | |
yarn npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to Github | |
run: | | |
yarn config set npmAuthToken ${NODE_AUTH_TOKEN} | |
yarn config set npmPublishRegistry "https://npm.pkg.github.com" | |
yarn npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |