Files
nimbus/.github/workflows/release.yml
2026-01-13 02:35:44 +01:00

71 lines
2.1 KiB
YAML

name: release-please
on:
push:
branches:
- base
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.CI_TOKEN }}
target-branch: base
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# Handle the PR artifacts while the PR is open/updated
# The output 'pr' is only present if a release PR was created or updated.
- name: Checkout PR branch
if: ${{ steps.release.outputs.pr }}
uses: actions/checkout@v4
with:
# Use headBranchName from the PR object
ref: ${{ fromJson(steps.release.outputs.pr).headBranchName }}
- name: Setup Node
if: ${{ steps.release.outputs.pr }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Cache node_modules
if: ${{ steps.release.outputs.pr }}
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: ${{ steps.release.outputs.pr }}
run: npm ci
- name: Get version from package.json
if: ${{ steps.release.outputs.pr }}
id: package_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Generate production artifacts
if: ${{ steps.release.outputs.pr }}
run: npm run build
- name: Commit and push changes
if: ${{ steps.release.outputs.pr }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "build: update production artifacts for v${{ steps.package_version.outputs.version }}"
file_pattern: "resources/dist/*"
branch: ${{ fromJson(steps.release.outputs.pr).headBranchName }}