Version Packages (beta) (#1201) #2875
This file contains 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: Run build, test & publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- develop | |
- beta | |
- nightly | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
build-lint-test: | |
if: contains(github.event.pull_request.title, ':tada:') == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Repo | |
uses: ./tools/github/setup-repo | |
- run: bun build:ci | |
- run: bun lint:ci | |
- name: Lint Playgrounds | |
continue-on-error: true | |
run: bun --filter='./playgrounds/**' lint && bun --filter='./playgrounds/**' type-check | |
- name: Test | |
if: contains(github.ref_name, 'nightly') == false | |
run: bun test:ci | |
publish: | |
if: contains(github.ref_name, 'develop') || contains(github.ref_name, 'nightly') || contains(github.ref_name, 'beta') | |
needs: [build-lint-test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Repo | |
uses: ./tools/github/setup-repo | |
- name: Replace versions | |
run: bun run ./scripts/replace-versions.ts | |
- name: Copy npmrc config | |
run: cp .npmrc.prod .npmrc | |
- name: Change nightly changeset | |
if: contains(github.ref_name, 'nightly') | |
continue-on-error: true | |
run: | | |
bun changeset version --snapshot nightly | |
- name: Change beta changeset | |
if: contains(github.ref_name, 'beta') | |
continue-on-error: true | |
run: | | |
bun changeset pre enter beta | |
- name: Set job params | |
shell: bash | |
id: deployment-params | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
echo "publishName=${{ github.ref_name == 'develop' && 'Release' || github.ref_name }}" >> $GITHUB_OUTPUT | |
- name: Create Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
if: contains(github.ref_name, 'develop') | |
with: | |
title: ":tada: Publish ${{ steps.deployment-params.outputs.publishName }}" | |
version: bun version-bump | |
publish: bun publish-packages | |
setupGitUser: false | |
- name: Publish Beta to npm | |
uses: changesets/action@v1 | |
if: contains(github.ref_name, 'beta') | |
with: | |
title: ":tada: Publish Beta" | |
version: bun version-bump | |
publish: bun publish-packages | |
setupGitUser: false | |
- name: Publish Nightly to npm | |
uses: changesets/action@v1 | |
if: contains(github.ref_name, 'nightly') | |
with: | |
title: ":tada: Publish Nightly" | |
version: bun version-bump | |
publish: bun publish-packages --tag nightly | |
setupGitUser: false | |
deploy-playground: | |
if: contains(github.ref_name, 'develop') | |
needs: [build-lint-test] | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Repo | |
uses: ./tools/github/setup-repo | |
- name: Setup Pages | |
uses: actions/[email protected] | |
- name: Build playground | |
run: | | |
bun run build | |
bun playground:vite build-playground | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
path: "./playgrounds/vite/dist" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/[email protected] |