feat(cli): arco add table — full CRUD scaffold in one command #55
Workflow file for this run
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: Publish @guanzhu.me/arco-cli to npm | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write # bumped from `read` so the release step can create a GitHub Release | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: npm-publish | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile --ignore-scripts | |
| - name: Verify CLI package | |
| run: yarn verify | |
| - name: Publish CLI package | |
| run: npm publish --access public --provenance --ignore-scripts | |
| - name: Extract release notes from CHANGELOG | |
| id: notes | |
| run: | | |
| set -euo pipefail | |
| version="${GITHUB_REF_NAME#v}" | |
| # awk walks the CHANGELOG and prints lines from the `## [x.y.z]` | |
| # heading up to (but not including) the next `## [` heading. | |
| awk -v ver="$version" ' | |
| BEGIN { in_section = 0 } | |
| /^## \[/ { | |
| if (in_section) { exit } | |
| if ($0 ~ "^## \\[" ver "\\]") { in_section = 1; next } | |
| } | |
| in_section { print } | |
| ' CHANGELOG.md > release-notes.md | |
| # Fallback to the tag message when the version isn't yet documented. | |
| if [ ! -s release-notes.md ]; then | |
| echo "Release ${GITHUB_REF_NAME}." > release-notes.md | |
| fi | |
| echo "Generated release notes ($(wc -l < release-notes.md) lines):" | |
| cat release-notes.md | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes-file release-notes.md \ | |
| --verify-tag |