fix: update repository URL #18
| name: Build and Publish API | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # set up Node/Yarn and build the package | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| - name: Set up Node | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 24.x | ||
| cache: "yarn" | ||
| - name: Install packages | ||
| run: yarn install | ||
| - name: Build package | ||
| run: yarn build | ||
| - name: Commit changes | ||
| uses: EndBug/add-and-commit@v9 | ||
| with: | ||
| author_name: Upryzing CI | ||
| author_email: upryzing-ci@users.noreply.github.com | ||
| message: "chore: build library from latest spec [skip ci]" | ||
| # publish the package if needed | ||
| - name: Find current API version | ||
| run: echo "api_version=$(jq -r .info.version OpenAPI.json)" >> $GITHUB_ENV | ||
| - name: Check if tag exists for current version | ||
| uses: mukunku/tag-exists-action@v1.2.0 | ||
| id: checkTag | ||
| with: | ||
| tag: ${{ env.api_version }} | ||
| - name: Update version in package.json | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 44 in .github/workflows/build_and_publish.yml
|
||
| run: | | ||
| jq '.version="${{ env.api_version }}"' package.json > temp.json | ||
| mv temp.json package.json | ||
| - name: Commit changes | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 49 in .github/workflows/build_and_publish.yml
|
||
| uses: EndBug/add-and-commit@v9 | ||
| with: | ||
| author_name: Upryzing CI | ||
| author_email: upryzing-ci@users.noreply.github.com | ||
| tag: "${{ env.api_version }} --force" | ||
| message: "chore: bump version to ${{ env.api_version }} [skip ci]" | ||
| - name: Publish to NPM | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 57 in .github/workflows/build_and_publish.yml
|
||
| run: npm publish | ||
| # update upryzing.js's repo | ||
| - name: Checkout upryzing.js repository | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 62 in .github/workflows/build_and_publish.yml
|
||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: upryzing/upryzing.js | ||
| path: upryzing.js | ||
| token: ${{ secrets.PAT }} | ||
| - name: Update @upryzing/api dependency | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 69 in .github/workflows/build_and_publish.yml
|
||
| run: cd upryzing.js && corepack enable && pnpm add @upryzing/api@${{ env.api_version }} | ||
| - name: Commit changes | ||
| if: ${{ steps.checkTag.outputs.exists }} != true | ||
|
Check warning on line 72 in .github/workflows/build_and_publish.yml
|
||
| uses: EndBug/add-and-commit@v9 | ||
| with: | ||
| cwd: "upryzing.js" | ||
| author_name: Upryzing CI | ||
| author_email: upryzing-ci@users.noreply.github.com | ||
| message: "chore: update @upryzing/api to ${{ env.api_version }}" | ||