mirror of
https://github.com/directus/directus.git
synced 2026-02-07 09:35:17 -05:00
* Use pnpm instead of npm * Setup workspace * Replace scripts / lerna root stuff * Add todo file * Update lock, start updating packages * Update todo * [WIP] Keep going on module resolution in pnpm * Fix final missing deps/types for complete build * [WIP] Replace npm commands with pnpm alternatives * Update jest config for v28 * Fix missing package under schema * Update workflow * Run CI on fork * Use local reference * Remove version from local workflow * Add build to prepare * Add Node's max old space size flag to linter * Idemdito for codeql * Hyphens? Underscores? * Bang * Only build one thing at a time * Underscores after all? * Match 7gb of GH * Set env on prepare * Jest is driving me nuts * Downgrade jest * Add root jest * We'll get there, eventually. * 🥳 * Het houdt niet op, niet vanzelf * attempt to fix e2e * fix unit test & shared import * add `debug: true` to CodeQL action * Fix dev call in shared * Add missing cross-env * Add missing geo-json dependency for app * add flag to prepare action to skip build * remove debug flag from codeql action * fix invalid env syntax * add tslib to app dependencies for tests * another attempt * Added missing rimraf dependency for the api prebuild/cleanup scripts * Added missing ts-node dependency for the api cli script * update E2E tests readme to use pnpm * Undo move of extensions sdk * Fixes nested groups in accordions not rendering fields (#14369) * initial fix for nested groups in accordions * removed debug code * Fix strict relative dates showing "incorrect" (#14390) * Set rounding method of relative formatted date to floor when strict option is selected * Add round fn as an option Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> * Don't use locales in generated camelCased values from env (#14401) Ref https://github.com/directus/directus/discussions/14122 * Fix list panel descending sort (#14396) * fix list panel descending sort * Handle missing or explicit desc value Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> * Fix query primary field for system tables (#14402) * New Crowdin updates (#14403) * Update source file en-US.yaml * New translations en-US.yaml (Spanish, Chile) * New translations en-US.yaml (Spanish, Latin America) * New translations en-US.yaml (Greek) * New translations en-US.yaml (Italian) * New translations en-US.yaml (French, Canada) * Fix/wysiwyg context menu (#14404) * New translations en-US.yaml (Polish) (#14407) * Encoded the url using encodeURIComponent, so that the url gets sanitzed and so, we did not get 404 error. (#14418) * Encoded the url using encodeURIComponent, so that the url gets sanitized and we did not get 404 error. * Added required changes as stated by the reviewer * Used encodeURI instead of encodeURIComponent to encode the params only * Solved linting error * Solved linting errors * checked with npm run lint, no linting errors found * fix generateJoi error due to empty permissions when creating new role (#14416) * fix empty permissions when creating new role * basic test * move logic up * additional test * Update api/tests/utils/filter-items.test.ts Co-authored-by: ian <licitdev@gmail.com> Co-authored-by: ian <licitdev@gmail.com> * Recreate lockfile * Fix build of extensions-sdk * Add missing dependency * Add some more missing deps * Update blackbox to use pnpm * Update workflow to use main * Update pack to work with pnpm * Simplify commands * Remove todo file (completed) * ADd missing types dep * Use local test version * Remove version from local reference * Call super with context * Add missing dep * Simplify workflows Ref https://github.com/directus/organization/issues/135 * Simplify some more * Linter is on root Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Co-authored-by: brainslug <tim@brainslug.nl> Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Gerard Lamusse <gerardlamo@gmail.com> Co-authored-by: José Varela <joselcvarela@gmail.com> Co-authored-by: ian <licitdev@gmail.com> Co-authored-by: Zeel Pathak <60271095+zeel-pathak@users.noreply.github.com>
168 lines
4.3 KiB
YAML
168 lines
4.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
env:
|
|
GHCR_IMAGE: ghcr.io/${{ github.repository }}
|
|
DOCKERHUB_IMAGE: ${{ github.repository }}
|
|
NODE_OPTIONS: --max_old_space_size=6144
|
|
|
|
jobs:
|
|
create-release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Create release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
body: |
|
|
Directus ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
build:
|
|
name: Build Packages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Prepare
|
|
uses: ./.github/actions/prepare
|
|
|
|
- name: Build
|
|
run: |
|
|
node docker/pack
|
|
|
|
- name: Cache build artifacts
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: '**/dist'
|
|
key: build-artifacts-${{ github.sha }}
|
|
|
|
publish-npm:
|
|
name: Publish to NPM
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
# Skip this step in forks
|
|
if: ${{ github.repository_owner == 'directus' }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Restore build artifacts
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: '**/dist'
|
|
key: build-artifacts-${{ github.sha }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.15'
|
|
registry-url: https://registry.npmjs.org
|
|
cache: npm
|
|
|
|
- uses: pnpm/action-setup@v2.0.1
|
|
name: Install pnpm
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i
|
|
|
|
- name: Publish packages to NPM
|
|
env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: |
|
|
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
|
|
pnpm -r publish --access=public --no-git-checks
|
|
|
|
build-images:
|
|
name: Build Images
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Restore build artifacts
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: '**/dist'
|
|
key: build-artifacts-${{ github.sha }}
|
|
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Extract metadata for Docker image
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: |
|
|
${{ env.DOCKERHUB_IMAGE }}
|
|
${{ env.GHCR_IMAGE }}
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1
|
|
if: ${{ env.DOCKERHUB_IMAGE }}
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@v1
|
|
if: ${{ env.GHCR_IMAGE }}
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./docker/Dockerfile
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
|
|
# 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
|