Skip to content

Commit 07e9be8

Browse files
committed
ci: add release ci
1 parent 1f2e364 commit 07e9be8

5 files changed

Lines changed: 346 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "pnpm install"
2+
description: "Run pnpm install with cache enabled"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up swap space
7+
if: runner.os == 'Linux'
8+
uses: pierotofy/set-swap-space@v1.0
9+
with:
10+
swap-size-gb: 10
11+
12+
- uses: pnpm/action-setup@v4.1.0
13+
name: Install pnpm
14+
with:
15+
run_install: false
16+
17+
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
18+
id: pnpm-config
19+
shell: bash
20+
run: |
21+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
22+
23+
- name: Cache rotation keys
24+
id: cache-rotation
25+
shell: bash
26+
run: |
27+
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
28+
29+
- uses: actions/cache@v4
30+
name: Setup pnpm cache
31+
with:
32+
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
33+
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
34+
restore-keys: |
35+
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
36+
37+
- name: Install dependencies
38+
shell: bash
39+
run: |
40+
pnpm install --frozen-lockfile --prefer-offline --loglevel error
41+
env:
42+
HUSKY: "0"

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
package:
7+
description: "The published name of a single package to release"
8+
type: choice
9+
required: false
10+
options:
11+
- "all"
12+
- "@nanoforge-dev/loader-client"
13+
- "@nanoforge-dev/loader-server"
14+
- "@nanoforge-dev/loader-website"
15+
exclude:
16+
description: "Comma separated list of packages to exclude from release (if not depended upon)"
17+
required: false
18+
type: string
19+
dry_run:
20+
description: Perform a dry run?
21+
type: boolean
22+
default: false
23+
24+
permissions:
25+
contents: write
26+
27+
jobs:
28+
npm-publish:
29+
name: npm publish
30+
runs-on: ubuntu-latest
31+
if: github.repository_owner == 'NanoForge-dev'
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v6
35+
36+
- name: Install Node.js v24
37+
uses: actions/setup-node@v6
38+
with:
39+
node-version: 24
40+
package-manager-cache: false
41+
registry-url: https://registry.npmjs.org/
42+
43+
- name: Install dependencies
44+
uses: ./.github/actions/pnpm-install
45+
46+
- name: Build dependencies
47+
run: pnpm run build
48+
49+
- name: Release packages
50+
uses: ./node_modules/@nanoforge-dev/actions/dist/release-packages
51+
with:
52+
package: ${{ inputs.package }}
53+
exclude: ${{ inputs.exclude }}
54+
dry: ${{ inputs.dry_run }}
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.idea/betterCommentsSettings.xml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@commitlint/cli": "^20.1.0",
3131
"@commitlint/config-conventional": "^20.0.0",
3232
"@eslint/js": "^9.39.1",
33+
"@nanoforge-dev/actions": "^1.0.2",
3334
"@nanoforge-dev/utils-eslint-config": "^1.0.0",
3435
"@nanoforge-dev/utils-prettier-config": "^1.0.0",
3536
"@trivago/prettier-plugin-sort-imports": "^6.0.0",

0 commit comments

Comments
 (0)