2021-04-01 13:38:26 -04:00
|
|
|
name: Release
|
2021-04-01 02:04:28 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-04-01 13:40:25 -04:00
|
|
|
- main
|
2021-04-01 02:04:28 -04:00
|
|
|
|
|
|
|
jobs:
|
2021-05-26 09:39:13 -04:00
|
|
|
release:
|
2021-05-26 10:31:35 -04:00
|
|
|
name: ${{ matrix.channel }}
|
2021-04-01 02:04:28 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-26 10:31:35 -04:00
|
|
|
strategy:
|
|
|
|
max-parallel: 1
|
|
|
|
matrix:
|
|
|
|
channel:
|
|
|
|
- latest
|
|
|
|
- dev
|
2021-05-26 08:56:17 -04:00
|
|
|
|
2021-04-01 02:04:28 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2021-04-01 02:13:47 -04:00
|
|
|
uses: actions/checkout@v2
|
2021-04-01 02:04:28 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup node
|
2021-04-01 02:13:47 -04:00
|
|
|
uses: actions/setup-node@v2
|
2021-04-01 02:04:28 -04:00
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
registry-url: https://registry.npmjs.org
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn
|
|
|
|
|
|
|
|
- name: Prepare release
|
|
|
|
run: yarn prerelease
|
|
|
|
|
|
|
|
# https://github.com/changesets/action
|
2021-05-26 08:56:17 -04:00
|
|
|
- name: Create release pull request or Publish to npm
|
2021-05-26 10:31:35 -04:00
|
|
|
if: matrix.channel == 'latest'
|
2021-04-01 02:04:28 -04:00
|
|
|
uses: changesets/action@master
|
|
|
|
with:
|
|
|
|
publish: yarn changeset publish
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
|
2021-04-01 02:23:43 -04:00
|
|
|
# https://github.com/atlassian/changesets/blob/master/docs/snapshot-releases.md
|
2021-04-01 02:04:28 -04:00
|
|
|
- name: Release to @dev channel
|
2021-05-26 10:31:35 -04:00
|
|
|
if: matrix.channel == 'dev'
|
2021-04-01 02:04:28 -04:00
|
|
|
run: |
|
|
|
|
yarn changeset version --snapshot
|
|
|
|
yarn changeset publish --tag dev
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-05-26 08:56:17 -04:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|