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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-name: "@shotstack/schemas"
- dependency-name: "@shotstack/shotstack-canvas"
commit-message:
prefix: "chore"
include: "scope"
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

Expand All @@ -20,6 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: shotstack-studio-sdk

- uses: actions/setup-node@v4
Expand All @@ -30,7 +28,7 @@ jobs:
working-directory: shotstack-studio-sdk
run: npm install

- name: Run public verification suite
- name: Run verification suite
working-directory: shotstack-studio-sdk
run: npm run verify:ci

Expand All @@ -42,7 +40,6 @@ jobs:
path: shotstack-studio-sdk/coverage/
retention-days: 14

# ── Extended regression suite (skipped on forks) ─────────────
- name: "[Extended] Set up SSH for regression suite"
if: env.HAS_EXTENDED_TESTS == 'true'
uses: webfactory/ssh-agent@v0.9.0
Expand All @@ -62,3 +59,9 @@ jobs:
if: env.HAS_EXTENDED_TESTS == 'true'
working-directory: shotstack-studio-extended-regression-suite
run: npm test

- name: Dry run release
working-directory: shotstack-studio-sdk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --dry-run
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release
on:
push:
branches: [main]

permissions:
contents: read

jobs:
release:
name: Verify & Release
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

env:
HAS_EXTENDED_TESTS: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY != '' }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: shotstack-studio-sdk

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
working-directory: shotstack-studio-sdk
run: npm install

- name: Run verification suite
working-directory: shotstack-studio-sdk
run: npm run verify:ci

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: shotstack-studio-sdk/coverage/
retention-days: 14

- name: "[Extended] Set up SSH for regression suite"
if: env.HAS_EXTENDED_TESTS == 'true'
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.EXTENDED_REGRESSION_SSH_KEY }}

- name: "[Extended] Clone regression suite"
if: env.HAS_EXTENDED_TESTS == 'true'
run: git clone git@github.com:shotstack/shotstack-studio-extended-regression-suite.git

- name: "[Extended] Install test dependencies"
if: env.HAS_EXTENDED_TESTS == 'true'
working-directory: shotstack-studio-extended-regression-suite
run: npm install

- name: "[Extended] Run behavioural regression tests"
if: env.HAS_EXTENDED_TESTS == 'true'
working-directory: shotstack-studio-extended-regression-suite
run: npm test

- name: Release
working-directory: shotstack-studio-sdk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
package-lock=false
16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
["@semantic-release/npm", {
"pkgRoot": "."
}],
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,16 @@
"format": "prettier --ignore-path .gitignore --write .",
"verify:ci": "npm run lint && npm run typecheck && npm run test:coverage && npm run build && npm run test:package",
"release:check": "npm run verify:ci && npm run test:extended && npm pack --dry-run --json",
"prepublishOnly": "npm run release:check",
"prepublishOnly": "node scripts/publish-guard.cjs",
"generate:fonts": "npx tsx scripts/fetch-google-fonts.ts"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^12.0.6",
"@semantic-release/npm": "^13.1.5",
"@semantic-release/release-notes-generator": "^14.1.0",
"@types/howler": "^2.2.12",
"@types/jest": "^30.0.0",
"@types/node": "^22.9.0",
Expand All @@ -83,6 +89,7 @@
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"prettier": "^3.6.2",
"semantic-release": "^25.0.3",
"ts-jest": "^29.4.5",
"typescript": "^5.6.2",
"vite": "^5.4.10",
Expand All @@ -97,5 +104,9 @@
"pixi-filters": "^6.0.5",
"pixi.js": "^8.15.0",
"zod": "^4.0.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
11 changes: 11 additions & 0 deletions scripts/publish-guard.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if (!process.env.CI) {
console.error(
"\n" +
"========================================\n" +
" Do not run npm/pnpm publish locally.\n" +
" Releases are managed by CI pipeline.\n" +
" Push to main to trigger a release.\n" +
"========================================\n"
);
process.exit(1);
}
Loading