Reposition Library Insight landing page copy and clean up repo refs #6
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: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'zulu' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Build Project | |
| run: ./gradlew build | |
| - name: Build CLI Distribution | |
| run: ./gradlew installDist distZip distTar | |
| - name: Upload Distribution | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: library-insight-distribution | |
| path: | | |
| **/build/distributions/*.zip | |
| **/build/distributions/*.tar | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| **/build/distributions/*.zip | |
| **/build/distributions/*.tar | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Prepare npm package assets | |
| run: | | |
| # Copy dependent library jars | |
| mkdir -p npm/lib/ | |
| cp -R library-insight-cli/build/install/library-insight/lib/* npm/lib/ | |
| # Copy Custom AI Skill file | |
| cp .agents/skills/library-insight/SKILL.md npm/ | |
| - name: Publish to npm | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| cd npm | |
| # Synchronize package version with git tag | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| node -e "const fs = require('fs'); const pkg = require('./package.json'); pkg.version = '${VERSION}'; fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2));" | |
| # Publish to npm registry | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |