Skip to content

Commit

Permalink
chore: Set up canary releases (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Jun 13, 2024
1 parent 0e2150c commit 99e069a
Show file tree
Hide file tree
Showing 18 changed files with 3,963 additions and 7,475 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ jobs:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
version: 8.6.0
- uses: actions/setup-node@v3
with:
node-version: 18.17.0
node-version: 20.x
cache: 'pnpm'
- run: pnpm install

# Next.js caching
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/examples/*/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}
Expand All @@ -30,7 +28,7 @@ jobs:
- run: |
PLAYWRIGHT_VERSION=$(cat pnpm-lock.yaml | grep /@playwright/test@ | sed 's/.*@\([^:]*\):.*/\1/')
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Restore playwright
id: cache-playwright-browsers
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: prerelease

on:
push:
branches:
- canary

jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: 20.x
cache: 'pnpm'
- run: pnpm install
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- run: pnpm run publish --conventional-prerelease --preid canary --dist-tag canary
if: "${{startsWith(github.event.head_commit.message, 'fix: ') || startsWith(github.event.head_commit.message, 'feat: ')}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
19 changes: 9 additions & 10 deletions .github/workflows/publish.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: publish
name: release

on:
push:
branches:
- main

jobs:
build:
main:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.0
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: 18.x
node-version: 20.x
cache: 'pnpm'
- run: pnpm install
# Seems like after squash & merge the author is unknown to lerna
- run: git config --global user.email "[email protected]" && git config --global user.name "Jan Amann"
- run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- run: pnpm run publish
if: "${{startsWith(github.event.head_commit.message, 'fix: ') || startsWith(github.event.head_commit.message, 'feat: ')}}"
env:
Expand Down
Loading

0 comments on commit 99e069a

Please sign in to comment.