Prepare release all plugins as new beta #4450
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: | |
| branches: | |
| - main | |
| pull_request: | |
| merge_group: | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| name: 'build' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v7 | |
| - uses: perses/github-actions@v0.13.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_npm: true | |
| enable_go: true | |
| enable_cue: true | |
| cue_version: 'v0.16.1' | |
| - name: install percli | |
| uses: perses/cli-actions/actions/install_percli@v0.2.1 | |
| with: | |
| cli-version: 'v0.54.0' | |
| - name: cache cue deps | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/cue | |
| key: ${{ runner.os }}-cue-${{ hashFiles('**/module.cue') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cue- | |
| - name: install dependencies | |
| run: npm ci | |
| - name: build plugin | |
| if: github.event_name == 'release' | |
| run: go run ./scripts/build-plugins/build-plugins.go --tag=${{ github.event.release.tag_name }} | |
| - name: build all plugins | |
| if: github.event_name != 'release' | |
| run: go run ./scripts/build-plugins/build-plugins.go | |
| - name: store plugin archives | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: archives | |
| path: | | |
| **/*.tar.gz | |
| **/dist | |
| !node_modules | |
| e2e: | |
| name: 'e2e tests' | |
| needs: build # <--- CRITICAL: Wait for build to finish. PERSES_PLUGIN_ARCHIVE_PATHS accepts archive files only | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v7 | |
| - name: download plugin archives | |
| uses: actions/download-artifact@v8 # <--- Download the artifacts to use the archive files | |
| with: | |
| name: archives | |
| path: ./plugins/temp-archives | |
| - name: flatten plugin archives # <--- Move all plugins archive into a single folder for simplicity | |
| run: | | |
| mkdir -p ./plugins/development-archives | |
| find ./plugins/temp-archives -name "*.tar.gz" -exec mv {} ./plugins/development-archives/ \; | |
| rm -rf ./plugins/temp-archives | |
| ls -R ./plugins/development-archives | |
| - name: start dev env | |
| uses: hoverkraft-tech/compose-action@v3.1.0 | |
| with: | |
| compose-file: .github/dev/docker-compose.ci.yml | |
| - uses: perses/github-actions@v0.13.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_npm: true | |
| nvmrc_path: '.nvmrc' | |
| - name: install dependencies | |
| run: npm ci | |
| - name: install Playwright browsers | |
| run: npx playwright install --with-deps | |
| working-directory: e2e | |
| - name: run e2e tests | |
| run: npm run test:ci --prefix e2e -- src/tests | |
| release: | |
| name: 'release' | |
| needs: 'build' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC trusted publishing | |
| contents: write | |
| if: ${{ github.event.release.tag_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.TOKEN }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v7 | |
| - uses: perses/github-actions@v0.13.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_npm: true | |
| enable_go: true | |
| enable_cue: true | |
| cue_version: 'v0.16.1' | |
| nvmrc_path: './.nvmrc' | |
| - name: Download archive | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: archives | |
| - run: go run ./scripts/upload-archive/upload-archive.go -tag=${{ github.event.release.tag_name }} | |
| - name: Publish CUE module | |
| run: go run ./scripts/cue-publish/cue-publish.go -tag=${{ github.event.release.tag_name }} -token=${{ secrets.CUE_REG_TOKEN }} | |
| - name: Publish npm package | |
| run: go run ./scripts/npm-publish/npm-publish.go -tag=${{ github.event.release.tag_name }} |