Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release-please-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release-please-pr

on:
pull_request:
types:
- closed
branches:
- master

jobs:
release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: ${{ github.event.pull_request.merged == true && !startsWith(github.head_ref, 'release-please--branches--') }}
env:
YARN_RC_FILENAME: .yarnrc-public.yml
steps:
- uses: actions/setup-node@v6
with:
node-version: '24.11.0'
- 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
- uses: actions/github-script@v5
if: ${{ steps.release-please.outputs.pr }}
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
if: ${{ steps.release-please.outputs.pr }}
with:
ref: ${{ steps.extract-branch.outputs.result }}
- 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'
68 changes: 24 additions & 44 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,7 @@
name: release-please

jobs:
release-pr:
runs-on: ubuntu-latest
environment: ci
env:
CODEARTIFACT_REGISTRY_SERVER: ${{ vars.CODEARTIFACT_REGISTRY_SERVER }}
steps:
- uses: actions/setup-node@v6
with:
node-version: '24.11.0'
- 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
- uses: actions/github-script@v5
if: ${{ steps.release-please.outputs.pr }}
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
if: ${{ steps.release-please.outputs.pr }}
with:
ref: ${{ steps.extract-branch.outputs.result }}
- uses: ./.github/actions/prep-secure-registries
if: ${{ steps.release-please.outputs.pr }}
with:
aws-access-key-id: ${{ secrets.SHARED_CODEARTIFACT_AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SHARED_CODEARTIFACT_AWS_SECRET_KEY }}
- 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:
release-github:
runs-on: ubuntu-latest
environment: ci
env:
Expand All @@ -75,14 +33,36 @@
if: ${{ steps.release.outputs.release_created }}
- run: yarn dist
if: ${{ steps.release.outputs.release_created }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ steps.release.outputs.release_created }}
with:
name: dist
path: dist/
retention-days: 1
if-no-files-found: error
- 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 }}

release-public:
runs-on: ubuntu-latest
needs: release-github
env:
YARN_RC_FILENAME: .yarnrc-public.yml
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version-file: '.tool-versions'
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: Publish to npm
run: |
npm config set registry https://registry.npmjs.org
npm publish --access public

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: ${{ steps.release.outputs.release_created }}
Loading