Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add a release workflow #41

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
- '*'
mariusheine marked this conversation as resolved.
Show resolved Hide resolved

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",
mariusheine marked this conversation as resolved.
Show resolved Hide resolved
"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