-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (56 loc) · 2.15 KB
/
release-canary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Release Canary
on:
push:
branches-ignore:
- main
- changeset-release/main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Create .npmrc
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> .npmrc
- name: Setup pnpm 7
uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install Dependencies
run: pnpm i
- name: Create ENV file
run: |
touch .env
# This will run all build, test, and lint scripts in parallel,
# outlined in the turbo.json file
- name: Build, Test, & Lint
run: pnpm ci
- name: Setup Local Github Actions
run: pnpm run build --filter=github-actions --force
- name: Extract Canary Subject From Branch Name
id: get-canary-subject
uses: ./packages-internal/github-actions/src/get-canary-subject
- name: Publish Canary to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm changeset version --snapshot ${{ steps.get-canary-subject.outputs.canary-subject }}
pnpm changeset publish --tag ${{ steps.get-canary-subject.outputs.canary-subject }}
- name: Deploy OhMyWarp
run: |
npx wrangler pages deploy ./apps/teleporter-demo/dist --project-name=ohmywarp-teleporter --commit-dirty=true > deploy_output_ohmywarp-teleporter.txt
WRANGLER_LOG=debug npx wrangler pages deployment list --project-name=ohmywarp-teleporter
DEPLOY_URL_OH_MY_WARP=$(grep -oP -m 1 'https?://\S+' deploy_output_ohmywarp-teleporter.txt)
echo "DEPLOY_URL_OH_MY_WARP=$DEPLOY_URL_OH_MY_WARP" >> $GITHUB_ENV
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} # Scoped to deploy step for security