Skip to content

Commit

Permalink
Merge branch 'release/0.2.53'
Browse files Browse the repository at this point in the history
  • Loading branch information
titouanmathis committed Jul 16, 2024
2 parents 036d846 + 411e291 commit 89647d1
Show file tree
Hide file tree
Showing 50 changed files with 10,072 additions and 11,794 deletions.
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ui
type: php
docroot: packages/docs/.symfony/public
php_version: '8.3'
nodejs_version: '20.11.1'
nodejs_version: '22'
webserver_type: nginx-fpm
use_dns_when_possible: true
omit_containers: [db]
Expand Down
149 changes: 100 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: build

on:
push:
Expand All @@ -8,56 +8,107 @@ on:
pull_request:

jobs:

Build:
pkg_build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Build the package
run: npm run build

Docs-Build:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Build the package
run: npm run build

docs_build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Build the package
run: npm run docs:build
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache
with:
path: |
${{ steps.npm-cache-dir.outputs.dir }}
**/node_modules
.eslintcache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install modules
run: npm install --no-audit --no-fund
- name: Build the package
run: npm run docs:build

# @see https://docs.docker.com/build/ci/github-actions/cache/
docker_build:
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: ci/${{ github.job }}
BUILD_CACHE: /home/runner/.docker/buildkit
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: release

on:
push:
Expand All @@ -13,7 +13,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20.11
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Get npm cache directory
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: tests

on:
push:
Expand All @@ -8,13 +8,13 @@ on:
pull_request:

jobs:
Code-Quality:
code_quality:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
Expand All @@ -38,13 +38,13 @@ jobs:
- name: Run Prettier check
run: npm run lint:prettier

Unit-Node:
unit_node:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.11
node-version: 22
cache: 'npm'
- name: Get npm cache directory
id: npm-cache-dir
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
fail_ci_if_error: false
verbose: true

Unit-Pest:
unit_pest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -87,7 +87,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20.11
node-version: 22
cache: 'npm'

- run: npx bun install
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
fail_ci_if_error: false
verbose: true

Export-Size:
export_size:
runs-on: macos-latest
if: github.event_name == 'pull_request'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [v0.2.53](https://github.com/studiometa/ui/compare/0.2.52..0.2.53) (2024-07-16)

### Added

- Add `DataBind`, `DataModel`, `DataEffect` and `DataComputed` components ([#256](https://github.com/studiometa/ui/pull/256))

### Changed

- Update Node 20 → 22 ([#257](https://github.com/studiometa/ui/pull/257), 4f2d947)
- Add a Dockerfile for easy deployment of the documentation ([#257](https://github.com/studiometa/ui/pull/257), 016a509)

## [v0.2.52](https://github.com/studiometa/ui/compare/0.2.51..0.2.52) (2024-07-03)

### Added
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM node:22-slim AS install
WORKDIR /app
COPY ./package.json ./package.json
COPY ./package-lock.json ./package-lock.json
COPY ./packages/docs/package.json ./packages/docs/package.json
COPY ./packages/playground/package.json ./packages/playground/package.json
COPY ./packages/ui/package.json ./packages/ui/package.json
COPY ./packages/tests/package.json ./packages/tests/package.json
COPY ./patches ./patches
RUN npm install --no-audit --no-fund

FROM node:22-slim AS docs_builder
WORKDIR /app
COPY ./package.json ./package.json
COPY ./package-lock.json ./package-lock.json
COPY ./packages/playground/ ./packages/playground/
COPY ./packages/docs/ ./packages/docs/
COPY ./packages/ui/ ./packages/ui/
COPY --from=install /app/node_modules ./node_modules
RUN apt update && apt install git -y
RUN npm run docs:build

FROM serversideup/php:8.3-fpm-nginx
WORKDIR /app
USER root
COPY packages/docs/.symfony/ ./packages/docs/.symfony/
COPY packages/ui/ ./packages/ui/
COPY packages/twig-extension/ ./packages/twig-extension/
RUN composer install -d ./packages/docs/.symfony
RUN echo "APP_ENV=prod" > ./packages/docs/.symfony/.env.local
COPY --from=docs_builder /app/packages/docs/.symfony/public/-/ ./packages/docs/.symfony/public/-/
RUN chown -R www-data:www-data .
ENV NGINX_WEBROOT="/app/packages/docs/.symfony/public/"
ENV PHP_OPCACHE_ENABLE=1
USER www-data
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "studiometa/ui",
"version": "0.2.52",
"version": "0.2.53",
"description": "A set of opiniated, unstyled and accessible components.",
"license": "MIT",
"require": {
Expand Down
Loading

0 comments on commit 89647d1

Please sign in to comment.