2024-04-10 13:29:08 +00:00
|
|
|
name: CI-update-dist
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-04-10 22:21:22 +00:00
|
|
|
- 'main'
|
|
|
|
- 'release/**'
|
2024-04-12 15:55:46 +00:00
|
|
|
paths-ignore:
|
2024-04-12 04:00:54 +00:00
|
|
|
- 'dist/**'
|
2024-04-10 13:29:08 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-dist:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-04-12 04:00:54 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
2024-04-10 13:29:08 +00:00
|
|
|
|
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: sources/package-lock.json
|
|
|
|
|
|
|
|
- name: Build distribution
|
|
|
|
run: |
|
|
|
|
npm clean-install
|
|
|
|
npm run check
|
|
|
|
npm run compile
|
|
|
|
working-directory: sources
|
|
|
|
|
|
|
|
- name: Copy the generated sources/dist directory to the top-level dist
|
|
|
|
run: |
|
|
|
|
cp -r sources/dist .
|
|
|
|
|
|
|
|
# Commit and push changes; has no effect if the files did not change
|
|
|
|
# Important: The push event will not trigger any other workflows, see
|
|
|
|
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
|
|
|
|
- name: Commit & push changes
|
|
|
|
# Only run for the Gradle repository; otherwise when users create pull requests from their `main` branch
|
|
|
|
# it would erroneously update `dist` on their branch (and the pull request)
|
|
|
|
if: github.repository == 'gradle/actions'
|
|
|
|
uses: stefanzweifel/git-auto-commit-action@v5
|
|
|
|
with:
|
2024-04-12 04:00:54 +00:00
|
|
|
commit_message: '[bot] Update dist directory'
|
2024-04-10 13:29:08 +00:00
|
|
|
file_pattern: dist
|