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
13 changes: 13 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ To get ready to work on the codebase, please do the following:
5. Make your changes
6. Run `pnpm format && pnpm build && pnpm test:unit` to run ESLint/Prettier, build and tests
7. [Submit a pull request](https://github.com/NanoForge-dev/Engine/compare) (Make sure you follow the [conventional commit format](https://github.com/NanoForge-dev/Engine/blob/main/.github/COMMIT_CONVENTION.md))

## Releases

Releases use the shared workflows of [NanoForge-dev/actions](https://github.com/NanoForge-dev/actions) (`@v3`), configured in `.github/nanoforge.json`:

- `engine`: the runtime packages, one `shared` version for all of them, tagged `<version>`. Its releases also sync the docs.
- `utils`: `utils-eslint-config` and `utils-prettier-config`, released one at a time with their own version, tagged `<package>@<version>`.

1. Run the **Release PR** workflow (Actions tab). Leave `group` empty for `engine`, or set `utils` and the package in `packages`. Leave `version` empty to take it from the commits, and use `dry-run` to preview.
2. Review and merge the `releases/*` pull request with "Squash and merge".
3. Merging it triggers the **Release** workflow: it publishes the changed packages on npm, tags them, creates the GitHub release and, for `engine`, syncs the docs.

Run the **Alpha Release** workflow from a feature branch to publish an alpha of the packages listed in `packages`. Other merged pull requests release nothing: no group has `betaOnMerge`.
6 changes: 0 additions & 6 deletions .github/actions/emsdk-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up swap space
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@v1.0
with:
swap-size-gb: 10

- name: Cache rotation keys
id: cache-rotation
shell: bash
Expand Down
26 changes: 5 additions & 21 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
name: prepare
description: Prepare action
inputs:
pnpm-install:
description: Install pnpm depedencies
default: "true"
emsdk-install:
description: Install emscriptens
default: "true"
build:
description: Build packages
default: "true"
description: Installs Node.js, pnpm and the dependencies, then emsdk, then builds the packages
runs:
using: composite
steps:
- if: inputs.pnpm-install == 'true'
name: Install pnpm and Node.js
uses: pnpm/setup@c9883cc79df532ad1a7b81bf9ab944ceb090d65c
with:
runtime: node@26
cache: true
- name: Set up Node.js, pnpm and the dependencies
uses: nanoforge-dev/actions/setup@v3

- if: inputs.emsdk-install == 'true'
name: Install emsdk
- name: Install emsdk
uses: ./.github/actions/emsdk-install

- if: inputs.build == 'true'
name: Build packages
- name: Build packages
shell: bash
run: pnpm run build
34 changes: 34 additions & 0 deletions .github/nanoforge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://raw.githubusercontent.com/NanoForge-dev/actions/v3/schema/nanoforge.schema.json",
"groups": [
{
"name": "engine",
"packages": [
"@nanoforge-dev/asset",
"@nanoforge-dev/common",
"@nanoforge-dev/core",
"@nanoforge-dev/ecs",
"@nanoforge-dev/editor-lib",
"@nanoforge-dev/env",
"@nanoforge-dev/graphics-2d",
"@nanoforge-dev/graphics-3d",
"@nanoforge-dev/input",
"@nanoforge-dev/music",
"@nanoforge-dev/network",
"@nanoforge-dev/scene",
"@nanoforge-dev/sound"
],
"mode": "all",
"versioning": "shared",
"branchFormat": "releases/nanoforge@{version}",
"commitFormat": "chore: release @nanoforge-dev/engine@{version}"
},
{
"name": "utils",
"packages": ["@nanoforge-dev/utils-eslint-config", "@nanoforge-dev/utils-prettier-config"],
"mode": "single",
"versioning": "independent"
}
],
"docs": { "category": "engine", "references": true }
}
54 changes: 14 additions & 40 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
name: Alpha Release
# The alpha is <next version>-alpha.<branch>.<n>: the exact number is in the job summary.
run-name: Alpha release ${{ inputs.packages }} on ${{ github.ref_name }}${{ inputs.dry-run && ' (dry run)' || '' }}

on:
workflow_dispatch:
inputs:
package:
description: "The published name of a single package to release"
type: choice
required: true
options:
- "@nanoforge-dev/asset"
- "@nanoforge-dev/common"
- "@nanoforge-dev/core"
- "@nanoforge-dev/ecs"
- "@nanoforge-dev/editor-lib"
- "@nanoforge-dev/env"
- "@nanoforge-dev/graphics-2d"
- "@nanoforge-dev/graphics-3d"
- "@nanoforge-dev/input"
- "@nanoforge-dev/music"
- "@nanoforge-dev/network"
- "@nanoforge-dev/scene"
- "@nanoforge-dev/sound"
- "@nanoforge-dev/utils-eslint-config"
- "@nanoforge-dev/utils-prettier-config"
dry_run:
packages:
description: Comma-separated packages (empty = the only package of .github/nanoforge.json)
type: string
default: ""
dry-run:
description: Perform a dry run?
type: boolean
default: false
Expand All @@ -33,23 +19,11 @@ permissions:
id-token: write

jobs:
alpha-release:
alpha:
name: Alpha release
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev'
steps:
- name: Checkout repository
uses: actions/checkout@v7

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

- name: Release alpha
uses: ./node_modules/@nanoforge-dev/actions/actions/release-dev
with:
package: ${{ inputs.package }}
tag: alpha
dry: ${{ inputs.dry_run }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: nanoforge-dev/actions/.github/workflows/alpha-release.yml@v3
with:
packages: ${{ inputs.packages }}
dry-run: ${{ inputs.dry-run }}
secrets:
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
20 changes: 9 additions & 11 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: "Issue Labeler"
name: Issue Triage

on:
issues:
types: [opened]

permissions:
issues: write

jobs:
issue-triage:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-labeler.yml
enable-versioned-regex: 0
triage:
name: Triage
uses: nanoforge-dev/actions/.github/workflows/issue-triage.yml@v3
22 changes: 8 additions & 14 deletions .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
name: "Label sync"
name: Label Sync

on:
workflow_dispatch:
push:
branches:
- main
paths:
- ".github/labels.yml"

permissions:
contents: read
issues: write

jobs:
label-sync:
name: Label sync
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
if: github.repository_owner == 'NanoForge-dev'
steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Label sync
uses: crazy-max/ghaction-github-labeler@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
uses: nanoforge-dev/actions/.github/workflows/label-sync.yml@v3
39 changes: 10 additions & 29 deletions .github/workflows/pr-triage.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
name: "PR Triage"
name: PR Triage

on:
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
jobs:
label:
permissions:
contents: read
pull-requests: write
issues: write
name: Label
if: github.event.action != 'edited'
runs-on: ubuntu-latest
steps:
- name: Label pull request
uses: actions/labeler@v7
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
validate-title:
name: Validate title
runs-on: ubuntu-latest
steps:
- name: Validate pull request title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?!?: .{1,72}$"

echo "Title: \"$TITLE\""
permissions:
contents: read
pull-requests: write
issues: write

if [[ ! "$TITLE" =~ $REGEX ]]; then
exit 1
fi
jobs:
triage:
name: Triage
uses: nanoforge-dev/actions/.github/workflows/pr-triage.yml@v3
48 changes: 0 additions & 48 deletions .github/workflows/pre-release-single.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/pre-release.yml

This file was deleted.

Loading
Loading