Add Nimiq Branding CLI (nq) — pixel-verified component registry + CLI… #18
This file contains hidden or 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: Update Source | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| # Ignore changes from the action itself | |
| - '!src/src.md' | |
| - '!src/data/dist/nimiq-apps.json' | |
| - '!src/data/dist/nimiq-apps.archive.json' | |
| - '!src/data/dist/rpc-servers.json' | |
| - '!src/data/dist/nimiq-mini-apps.json' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-src: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v3 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: cd src && pnpm install | |
| - name: Lint (check) | |
| id: lint-check | |
| run: cd src && pnpm run lint | |
| continue-on-error: true | |
| - name: Fix lint issues | |
| id: lint-fix | |
| run: cd src && pnpm run lint:fix | |
| - name: Build src | |
| run: cd src && pnpm run build | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git add . | |
| git status --porcelain | grep -q "." && echo "changes=true" >> $GITHUB_OUTPUT || echo "changes=false" >> $GITHUB_OUTPUT | |
| - name: Commit and push if changed | |
| if: steps.git-check.outputs.changes == 'true' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| if [ "${{ steps.lint-check.outcome }}" = "failure" ]; then | |
| git commit -am "chore: auto-fix linting issues and update documentation" | |
| else | |
| git commit -am "chore: update documentation and distribution files" | |
| fi | |
| git push |