Update main.yml #10
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: CI | ||
| on: | ||
| push: | ||
| pull_request: | ||
| jobs: | ||
| check-lint-test-build: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: 'yarn' | ||
| - name: Enable Corepack | ||
| run: corepack enable | ||
| - name: Use specified Yarn version | ||
| run: corepack prepare yarn@4.5.1 --activate | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Lint | ||
| run: yarn lint | ||
| - name: Test | ||
| run: yarn test | ||
| - name: Build | ||
| run: yarn build | ||
| publish: | ||
| needs: ci | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: 'yarn' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| scope: '@hawk.so' | ||
| - name: Enable Corepack | ||
| run: corepack enable | ||
| - name: Use specified Yarn version | ||
| run: corepack prepare yarn@4.5.1 --activate | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Build | ||
| run: yarn build | ||
| - name: Publish | ||
| run: | | ||
| yarn workspace @hawk.so/utils exec npm publish --access public | ||
| yarn workspace @hawk.so/github-sdk exec npm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| - name: Get package info | ||
| id: package | ||
| uses: codex-team/action-nodejs-package-info@v1 | ||
| - name: Send a message | ||
| uses: codex-team/action-codexbot-notify@v1 | ||
| with: | ||
| webhook: ${{ secrets.CODEX_BOT_WEBHOOK_HAWK }} | ||
| message: '📦 [${{ steps.package.outputs.name }}](${{ steps.package.outputs.npmjs-link }}) ${{ steps.package.outputs.version }} was published' | ||
| parse_mode: 'markdown' | ||
| disable_web_page_preview: true | ||