Skip to content

Commit d24b58d

Browse files
committed
Merge branch 'main' into feat/server-api
# Conflicts: # v1/typescript-definitions/package-lock.json # v1/typescript-definitions/package.json # v1/typescript-definitions/src/main.ts
2 parents 12157e7 + 97642f7 commit d24b58d

File tree

6 files changed

+129
-6
lines changed

6 files changed

+129
-6
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish nightly to NPM
2+
3+
on:
4+
# Allows you to run this workflow manually from the Actions tab
5+
workflow_dispatch:
6+
7+
permissions:
8+
id-token: write # Required for OIDC
9+
contents: read
10+
11+
jobs:
12+
Publish:
13+
name: Publish to NPM
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
defaults:
17+
run:
18+
working-directory: ./v1/typescript-definitions
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: actions/setup-node@v5
22+
with:
23+
node-version: 24
24+
package-manager-cache: false
25+
registry-url: "https://registry.npmjs.org"
26+
27+
# Ensure npm 11.5.1 or later is installed:
28+
# - name: Update npm
29+
# run: npm install -g npm@latest
30+
31+
- name: Prepare Environment
32+
# Install from package-lock.json:
33+
run: npm ci
34+
env:
35+
CI: true
36+
37+
- name: Bump version to prerelease
38+
run: |
39+
PRERELEASE_TAG=nightly-$(echo "${{ github.ref_name }}" | sed -r 's/[^a-z0-9]+/-/gi')
40+
npm version prerelease --preid $PRERELEASE_TAG-$COMMIT_DATE-$GIT_HASH
41+
42+
- name: Generate types
43+
run: npm run generate-types
44+
env:
45+
CI: true
46+
47+
- name: Build
48+
run: npm run build
49+
env:
50+
CI: true
51+
52+
- name: Publish to NPM
53+
run: npm publish --tag nightly
54+
env:
55+
CI: true

.github/workflows/publish-npm.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to NPM
2+
3+
on:
4+
# Allows you to run this workflow manually from the Actions tab
5+
workflow_dispatch:
6+
7+
permissions:
8+
id-token: write # Required for OIDC
9+
contents: read
10+
11+
jobs:
12+
Publish:
13+
name: Publish to NPM
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 15
16+
defaults:
17+
run:
18+
working-directory: ./v1/typescript-definitions
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: actions/setup-node@v5
22+
with:
23+
node-version: 24
24+
package-manager-cache: false
25+
registry-url: "https://registry.npmjs.org"
26+
27+
# Ensure npm 11.5.1 or later is installed:
28+
# - name: Update npm
29+
# run: npm install -g npm@latest
30+
31+
- name: Prepare Environment
32+
# Install from package-lock.json:
33+
run: npm ci
34+
env:
35+
CI: true
36+
37+
- name: Generate types
38+
run: npm run generate-types
39+
env:
40+
CI: true
41+
42+
- name: Build
43+
run: npm run build
44+
env:
45+
CI: true
46+
47+
- name: Publish to NPM
48+
run: npm publish --tag latest
49+
env:
50+
CI: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ It allows for vendor interoperability between Graphics, Rendering systems and Co
3636

3737
Useful resources:
3838
* [Examples of OGraf Graphics](https://github.com/ebu/ograf/tree/main/v1/examples).
39-
* [OGraf Specification](./v1/specification/docs/Specification).
39+
* [OGraf Specification](./v1/specification/docs/Specification.md).
4040

4141

4242
### Tools

v1/typescript-definitions/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,24 @@ The instructions below are for developers who want to work on the Typescript def
6666
```bash
6767

6868
npm install
69+
npm run generate-types # Run this if the Graphics API has changed
70+
npm run generate-server-types # Run this if the server API has changed
71+
72+
6973
npm run build
7074
# or
7175
npm run watch
7276

7377
```
78+
79+
### Publish to NPM
80+
81+
To publish a new version to NPM:
82+
83+
1. Bump the version `npm version major|minor|patch`
84+
2. Commit and push to GitHub
85+
3. Go to the Actions tab and trigger the "Publish to NPM" workflow
86+
87+
To publish a nightly build to NPM:
88+
89+
1. Go to the Actions tab and trigger the "Publish nightly to NPM" workflow

v1/typescript-definitions/package-lock.json

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

v1/typescript-definitions/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"name": "ograf",
3-
"version": "0.1.0-server-api.0",
3+
"version": "1.0.0",
44
"main": "dist/main.js",
55
"types": "dist/main.d.ts",
66
"license": "MIT",
77
"description": "TypeScript definitions for Ograf graphics",
8+
"repository": {
9+
"url": "https://github.com/ebu/ograf"
10+
},
811
"homepage": "https://ograf.ebu.io",
912
"keywords": [
1013
"ograf",
@@ -19,8 +22,7 @@
1922
"watch": "tsc --watch",
2023
"generate-types": "node scripts/generate-types.js",
2124
"generate-server-types": "openapi-typescript ../specification/open-api/server-api.yaml -o ./src/generated/server-api.d.ts --additional-properties=true && node scripts/post-generate-server-types.js",
22-
"build-all": "npm run generate-types && npm run generate-server-types && npm run build",
23-
"do:publish": "npm run build-all && npm publish --access public --tag next"
25+
"build-all": "npm run generate-types && npm run generate-server-types && npm run build"
2426
},
2527
"devDependencies": {
2628
"json-schema-to-typescript": "^15.0.4",

0 commit comments

Comments
 (0)