chore: fix the condition #94
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: Release | |
| on: | |
| workflow_run: | |
| workflows: [ Test ] | |
| branches: [ main ] | |
| types: | |
| - completed | |
| push: | |
| branches: [ next, prerelease ] | |
| # This part sets up the Trusted Publishers for npm via GitHub Actions, | |
| # that's why we don't need to set up the token manually | |
| permissions: | |
| id-token: write | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: cache-node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build the CLI | |
| run: npm run build | |
| - name: Run npm release | |
| run: npm run release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GIT_AUTHOR_NAME: Tolgee Machine | |
| GIT_AUTHOR_EMAIL: machine@tolgee.io | |
| GIT_COMMITTER_NAME: Tolgee Machine | |
| GIT_COMMITTER_EMAIL: machine@tolgee.io |