Skip to content

Add Layout Components (#736) #2702

Add Layout Components (#736)

Add Layout Components (#736) #2702

Workflow file for this run

name: Build, Test and Publish @draftbit/ui
on:
push:
branches:
- master
- 48
pull_request:
types: [assigned, opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 16.18
cache: "yarn"
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn install
- name: Type Check
run: yarn typescript
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: Release next packages
if: github.event_name == 'pull_request'
env:
NODE_AUTH_TOKEN: ${{ secrets.JIGSAW_AUTH_TOKEN }}
run: |
# Publishes pre-release versions of any changed packages
yarn lerna publish \
--dist-tag next \
--ignore-scripts \
--canary \
--preid $(git rev-parse --short=6 HEAD) \
--yes \
- name: Release packages (master)
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
env:
NODE_AUTH_TOKEN: ${{ secrets.JIGSAW_AUTH_TOKEN }}
run: |
# Only publishes when finding a new `lerna version` was pushed to
# the branch. But for purposes of _this_ action, that means master.
# You have to manually run lerna version locally and get that PR
# merged before this does anything.
yarn lerna publish from-package \
--ignore-scripts \
--yes \
--no-verify-access
- name: Release packages (48)
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/48'
env:
NODE_AUTH_TOKEN: ${{ secrets.JIGSAW_AUTH_TOKEN }}
run: |
yarn lerna publish from-package \
--ignore-scripts \
--yes \
--no-verify-access
- name: Release to Snack (PRs)
if: github.event_name == 'pull_request'
run: |
# Release to snack so available to test
# This hits Snack twice because it commonly times out the first time
export newversion=$(npm view @draftbit/ui dist-tags.next);
sleep 10
curl "https://snackager.expo.io/bundle/@draftbit/ui@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/ui@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/core@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/core@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/maps@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/maps@"$newversion"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
working-directory: packages/ui
- name: Release to Snack
if: github.event_name != 'pull_request'
run: |
# Release to snack
# This hits Snack twice because it commonly times out the first time
export version=$(jq -r .version package.json);
sleep 10
curl "https://snackager.expo.io/bundle/@draftbit/ui@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/ui@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/core@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/core@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/maps@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
curl "https://snackager.expo.io/bundle/@draftbit/maps@"$version"?version_snackager=true&platforms=ios,android,web&bypassCache=true";
working-directory: packages/ui
- name: Add comment to pull request
if: github.event_name == 'pull_request'
env:
URL: ${{ github.event.pull_request.comments_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(npm view @draftbit/ui dist-tags.next);
curl -X POST $URL \
-H "Content-Type: application/json" \
-H "Authorization: token $GITHUB_TOKEN" \
--data "{ \"body\": \"Published version: [@draftbit/ui@$VERSION](https://www.npmjs.com/package/@draftbit/ui/v/$VERSION)\" }"