Skip to content

Commit

Permalink
chore: add a release workflow (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashass authored Nov 21, 2024
1 parent 401de1d commit 84174db
Show file tree
Hide file tree
Showing 7 changed files with 3,254 additions and 2,644 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/playground.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true
- run: pnpm -r build:playground
- name: Upload Pages artifact
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'

- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v4
with:
version: 9
run_install: true

- name: Build
working-directory: packages/former/
run: pnpm build

- name: Set version
working-directory: packages/former/
run: pnpm version ${GITHUB_REF#refs/*/} --no-commit-hooks --no-git-tag-version
if: 'github.ref_type == ''tag'''

- name: Release
working-directory: packages/client/
run: pnpm publish --no-git-check --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: 'github.ref_type == ''tag'''
52 changes: 15 additions & 37 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,40 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true
- run: pnpm lint

typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true
- run: pnpm test

unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v3
node-version: 22
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: true
- run: pnpm test

# e2e:
# name: Playwright Tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: pnpm/action-setup@v3
# with:
# version: 8
# run_install: true
# - run: pnpm build:package
# - run: npx playwright install --with-deps
# - run: pnpm test || exit 1
# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: playwright-report
# path: playground/playwright-report/
# retention-days: 30
8 changes: 4 additions & 4 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
tasks:
- name: Setup gitpod env
before: |
nvm install 20
nvm use 20
npm install -g pnpm@8
nvm alias default 20
nvm install 22
nvm use 22
npm install -g pnpm@9
nvm alias default 22
echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
init: pnpm install && pnpm run build
Expand Down
6 changes: 3 additions & 3 deletions packages/former/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "former-ui",
"type": "module",
"version": "0.0.11-next.55",
"version": "0.0.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -45,9 +45,9 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.4",
"@tsconfig/node22": "^22.0.0",
"@types/lodash": "^4.17.7",
"@types/node": "^20.12.5",
"@types/node": "^22.9.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/tsconfig": "^0.5.1",
"@vueuse/core": "^10.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/former/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "ESNext",
Expand Down
Loading

0 comments on commit 84174db

Please sign in to comment.