Version Packages (#40) #63
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: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- 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: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
# This expects you to have a script called release which does a build for your packages and calls changeset publish | |
publish: pnpm release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} | |
- 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 |