Skip to content

Commit

Permalink
chore: ci publish
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Sep 14, 2024
1 parent df23646 commit 96f0f55
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Main CI
name: CI

on: [push]
on: [push, workflow_call]

jobs:
lint:
Expand Down
68 changes: 12 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,11 @@ name: Release
on: workflow_dispatch

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint

typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Type Check
run: pnpm typecheck

tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Test
run: pnpm test
checks:
uses: ./.github/workflows/ci.yml

release:
needs: checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -66,12 +19,15 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore(release): update versions'
publish: pnpm ci:publish
- name: Tag and Release
run: |
pnpm ci:version
git add .
git commit -m "chore(release): publish"
pnpm get-tag
git tag "$(<./version.output.txt)"
pnpm ci:publish
git push && git push --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ dist
lerna-debug.log
packages/*/dist/**
packages/*/src/playground.ts
version.output.txt
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"dev": "tsx scripts/watch.ts",
"prepare": "husky",
"ci:publish": "pnpm build && pnpm publish --provenance --access public -r",
"ci:version": "pnpm changeset version && cp ./packages/core/CHANGELOG.md ./CHANGELOG.md"
"ci:version": "pnpm changeset version && cp ./packages/core/CHANGELOG.md ./CHANGELOG.md",
"get-tag": "tsx ./scripts/get-tag.ts"
},
"devDependencies": {
"@changesets/cli": "^2.27.8",
Expand Down
4 changes: 4 additions & 0 deletions scripts/get-tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { version } from '../packages/core/package.json';
import fs from 'fs';

fs.writeFileSync('version.output.txt', `v${version}`);

0 comments on commit 96f0f55

Please sign in to comment.