Skip to content
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @Exeloo @bill-h4rper
* @Exeloo @bill-h4rper @Tchips46
20 changes: 17 additions & 3 deletions .github/actions/docker-push/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: docker-push
description: Push Docker image on registry
inputs:
target:
description: Target name
required: true
args:
description: Arguments to pass to docker build
required: false
registry:
description: Docker registry
required: true
Expand All @@ -13,9 +19,16 @@ inputs:
github-token:
description: Github token
required: true
config-file:
description: Path to config file
required: true
runs:
using: composite
steps:
- name: Fetch all history for all tags
run: git fetch --prune --unshallow
shell: bash

- name: Determine latest tag
id: tag
shell: bash
Expand Down Expand Up @@ -45,6 +58,7 @@ runs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ inputs.args }}

- name: checkout cloud for tags update
uses: actions/checkout@v6
Expand All @@ -65,8 +79,8 @@ runs:
shell: sh
run: |
cd cloud-iac
python -m yq -Y --indentless --in-place '.image.tag = "${{ steps.tag.outputs.tag }}"' kubernetes/nanoforge/editor-override.yaml
python -m yq -Y --indentless --in-place '.image.tag = "${{ steps.tag.outputs.tag }}"' ${{ inputs.config-file }}

git add kubernetes/nanoforge/editor-override.yaml || echo "No changes to add"
git commit -m "chore(editor): release docker nanoforge-dev/editor@${{ steps.tag.outputs.tag }}" || echo "No changes to commit"
git add ${{ inputs.config-file }} || echo "No changes to add"
git commit -m "chore(${{ inputs.target }}): release docker nanoforge-dev/${{ inputs.target }}@${{ steps.tag.outputs.tag }}" || echo "No changes to commit"
git push || echo "No changes to push"
6 changes: 6 additions & 0 deletions .github/actions/pnpm-install/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: 'pnpm install'
description: 'Run pnpm install with cache enabled'
inputs:
path:
description: 'Path to the directory containing the pnpm workspace'
default: '.'
runs:
using: 'composite'
steps:
Expand All @@ -13,6 +17,7 @@ runs:
name: Install pnpm
with:
run_install: false
package_json_file: ${{ inputs.path }}/package.json

- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
id: pnpm-config
Expand Down Expand Up @@ -40,3 +45,4 @@ runs:
pnpm install --frozen-lockfile --prefer-offline --loglevel error
env:
HUSKY: '0'
working-directory: ${{ inputs.path }}
35 changes: 35 additions & 0 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Alpha Release

on:
workflow_dispatch:
inputs:
dry_run:
description: Perform a dry run?
type: boolean
default: false

permissions:
contents: write
id-token: write

jobs:
alpha-release:
name: Alpha release
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev' && github.ref_name != 'main' && github.ref_name != 'master'
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Prepare
uses: ./.github/actions/prepare

- name: Release alpha
uses: ./node_modules/@nanoforge-dev/actions/actions/release-dev
with:
package: '@nanoforge-dev/editor'
tag: alpha
dry: ${{ inputs.dry_run }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 5 additions & 9 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_dispatch:
inputs:
version:
description: 'New version of the package (leave empty for auto generated version)'
description: New version for the packages
type: string
required: false
required: true
dry_run:
description: Perform a dry run?
type: boolean
Expand All @@ -30,16 +30,12 @@ jobs:

- name: Prepare
uses: ./.github/actions/prepare
env:
PUBLIC_MODE: ${{ vars.PUBLIC_MODE }}
PUBLIC_PM_URL: ${{ vars.PUBLIC_PM_URL }}

- name: Release packages
uses: ./node_modules/@nanoforge-dev/actions/dist/create-release-pr
- name: Create release PR
uses: ./node_modules/@nanoforge-dev/actions/actions/create-packages-release-pr
with:
package: '@nanoforge-dev/editor'
packages: '@nanoforge-dev/editor'
version: ${{ inputs.version }}
dry: ${{ inputs.dry_run }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_REPO: ${{ github.repository }}
35 changes: 0 additions & 35 deletions .github/workflows/release-tag.yml

This file was deleted.

96 changes: 81 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Release

on:
workflow_dispatch:
inputs:
dry_run:
description: Perform a dry run?
type: boolean
default: false
pull_request:
types:
- closed
branches:
- main

env:
REGISTRY: ghcr.io
Expand All @@ -21,16 +20,13 @@ permissions:
id-token: write

jobs:
create-release:
name: Create release
release:
name: Release
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev'
if: github.repository_owner == 'NanoForge-dev' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/')
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Prepare
uses: ./.github/actions/prepare
Expand All @@ -39,19 +35,89 @@ jobs:
PUBLIC_PM_URL: ${{ vars.PUBLIC_PM_URL }}

- name: Release packages
uses: ./node_modules/@nanoforge-dev/actions/dist/release-packages
uses: ./node_modules/@nanoforge-dev/actions/actions/release-packages
with:
packages: '@nanoforge-dev/editor'
tag-format: '{version}'
latest: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

beta-release:
name: Beta release
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev' && github.event.pull_request.merged == true && !startsWith(github.head_ref, 'releases/')
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Prepare
uses: ./.github/actions/prepare

- name: Release beta
uses: ./node_modules/@nanoforge-dev/actions/actions/release-dev
with:
package: '@nanoforge-dev/editor'
dry: ${{ inputs.dry_run }}
format: '{version}'
tag: beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

push-image:
name: Push image
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev'
needs: [release]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Push Docker image
uses: ./.github/actions/docker-push
with:
target: editor
registry: ${{ env.REGISTRY }}
image: ${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}
token: ${{ secrets.TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
config-file: ${{ env.CONFIG_FILE }}
args: |
PUBLIC_MODE
PUBLIC_PM_URL
env:
PUBLIC_MODE: ONLINE
PUBLIC_PM_URL: https://projects.nanoforge.eu

publish-docs:
name: Publish docs
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev'
needs: [push-image]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Checkout docs repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
path: docs-dist
repository: nanoforge-dev/docs
token: ${{ secrets.ACTIONS_KEY }}

- name: Prepare
uses: ./.github/actions/prepare

- name: Publish docs
uses: ./node_modules/@nanoforge-dev/actions/actions/synchronize-docs
with:
repository: editor
category: editor
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ WORKDIR /app

FROM base AS prod

ARG PUBLIC_MODE
ARG PUBLIC_PM_URL

ENV PUBLIC_MODE=${PUBLIC_MODE}
ENV PUBLIC_PM_URL=${PUBLIC_PM_URL}

RUN pnpm install --frozen-lockfile
COPY . /app
RUN pnpm run build
Expand Down
Loading