|
|
name: Release |
|
|
|
|
|
on: |
|
|
push: |
|
|
branches: |
|
|
- main |
|
|
|
|
|
permissions: {} |
|
|
jobs: |
|
|
release: |
|
|
permissions: |
|
|
contents: write |
|
|
pull-requests: write |
|
|
|
|
|
name: ${{ matrix.channel }} |
|
|
runs-on: ubuntu-latest |
|
|
strategy: |
|
|
max-parallel: 1 |
|
|
matrix: |
|
|
channel: |
|
|
- latest |
|
|
- dev |
|
|
|
|
|
steps: |
|
|
- name: Checkout repo |
|
|
uses: actions/checkout@v2 |
|
|
with: |
|
|
fetch-depth: 0 |
|
|
|
|
|
- name: Setup node |
|
|
uses: actions/setup-node@v4 |
|
|
with: |
|
|
node-version: 22.x |
|
|
cache: yarn |
|
|
registry-url: https://registry.npmjs.org |
|
|
key: node20 |
|
|
|
|
|
- name: Install dependencies |
|
|
run: yarn |
|
|
|
|
|
- name: Prepare release |
|
|
run: yarn prerelease |
|
|
|
|
|
|
|
|
- name: Create release pull request or Publish to npm |
|
|
if: matrix.channel == 'latest' |
|
|
uses: changesets/action@v1 |
|
|
with: |
|
|
|
|
|
version: yarn changesetversion |
|
|
publish: yarn changeset publish |
|
|
env: |
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false |
|
|
|
|
|
|
|
|
- name: Release to @dev channel |
|
|
if: matrix.channel == 'dev' |
|
|
run: | |
|
|
yarn changeset version --snapshot |
|
|
yarn changeset publish --tag dev |
|
|
env: |
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
|
|