Skip to content

fix: move checkout to allow tool-versions file to be used for node ve… #314

fix: move checkout to allow tool-versions file to be used for node ve…

fix: move checkout to allow tool-versions file to be used for node ve… #314

on:
push:
branches:
- master
name: release-please
jobs:
release-pr:
runs-on: ubuntu-latest
environment: ci
env:
CODEARTIFACT_AUTH_TOKEN: ${{ secrets.CODEARTIFACT_AUTH_TOKEN }}
steps:
- uses: actions/github-script@v5
id: extract-branch
env:
PR_NUM: ${{ steps.release-please.outputs.pr }}
with:
result-encoding: string
script: return JSON.parse(process.env.PR_NUM).headBranchName
- uses: actions/checkout@v5
with:
ref: ${{ steps.extract-branch.outputs.result }}
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: node
package-name: '@appfolio/react-gears'
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"refactor","section":"Miscellaneous","hidden":false}]'
command: release-pr
- run: yarn install --immutable
if: ${{ steps.release-please.outputs.pr }}
- run: yarn docs
if: ${{ steps.release-please.outputs.pr }}
- uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ steps.release-please.outputs.pr }}
with:
commit_message: 'docs: update documentation for the latest release'
release:
runs-on: ubuntu-latest
environment: ci
env:
CODEARTIFACT_AUTH_TOKEN: ${{ secrets.CODEARTIFACT_AUTH_TOKEN }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: '@appfolio/react-gears'
command: github-release
- uses: actions/checkout@v5
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
if: ${{ steps.release.outputs.release_created }}
- run: yarn install --immutable
if: ${{ steps.release.outputs.release_created }}
- run: yarn dist
if: ${{ steps.release.outputs.release_created }}
- name: Publish to GitHub
run: |
npm config set registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
npm publish
if: ${{ steps.release.outputs.release_created }}
- name: Publish to npm
run: |
npm config set registry https://registry.npmjs.org
npm publish --access public
if: ${{ steps.release.outputs.release_created }}