test: use vitest (#5740) #1852
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: Changeset (Release) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| deployments: read | |
| pull-requests: write | |
| statuses: write | |
| # This allows a subsequently queued workflow run to interrupt previous runs | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| release: | |
| name: Release | |
| environment: main | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 | |
| with: | |
| # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Use Node.js | |
| uses: ./.github/actions/setup-node | |
| - name: has changeset file | |
| id: changesetfiles | |
| run: | | |
| count=$(find .changeset -name "*.md" -type f | wc -l) | |
| echo "count=$count" >> $GITHUB_OUTPUT | |
| if [ $count -gt 0 ]; then | |
| echo "Found $count md file(s)" | |
| find .changeset -name "*.md" -type f | |
| else | |
| echo "No md files found" | |
| fi | |
| - name: Install and Build | |
| if: steps.changesetfiles.outputs.count == 1 | |
| run: yarn --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Install but do not build | |
| if: steps.changesetfiles.outputs.count > 1 | |
| run: yarn --ignore-scripts --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf #v1.7.0 | |
| with: | |
| # This expects you to have a script called release which does a build for your packages and calls changeset publish | |
| publish: yarn release | |
| commit: "chore: prepare release" | |
| title: "chore: prepare release" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CHANGESET_GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| update-cdn-content: | |
| needs: release | |
| environment: main | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| curl -XPOST -u "build-travis-ci:${{ secrets.CDN_CONTENT_PAT }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/talend/cdn-content/actions/workflows/download-talend-ui.yml/dispatches --data '{"ref": "main"}' |