Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a release process #36

Merged
merged 11 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

permissions:
id-token: write

on:
release:
types: [published]

jobs:
publish:
name: Typir Publish
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Build
shell: bash
run: |
npm ci
npm run clean
npm run build
- name: Test
if: success() || failure()
shell: bash
run: |
npm run test:run
- name: Publish NPM Packages
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Update the following list when a new npm package is added
run: |
npm run publish:latest --provenance --workspace=typir
npm run publish:latest --provenance --workspace=typir-langium
12 changes: 12 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Release Process

The release process is mostly automated and requires running only a few commands. After commiting, pushing, tagging and releasing the changes, a GitHub Action will publish all npm packages.
JohannesMeierSE marked this conversation as resolved.
Show resolved Hide resolved

1. Pull the latest changes
2. Uplift the package versions
Run `npm version major|minor|patch --no-git-tag-version --workspaces`
Lotes marked this conversation as resolved.
Show resolved Hide resolved
3. Update the dependency versions
Run `npm run version:dependencies`
Lotes marked this conversation as resolved.
Show resolved Hide resolved
4. Create a PR with your updated changes, get a review and merge it
5. Create a version tag on the latest commit on main and push it
6. Create a GitHub release from the new tag (this will automatically publish all artifacts)
Lotes marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 4 additions & 3 deletions examples/lox/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "lox",
"name": "typir-example-lox",
Lotes marked this conversation as resolved.
Show resolved Hide resolved
"displayName": "lox",
"version": "0.0.1",
"description": "Please enter a brief description here",
"private": true,
"description": "",
"author": {
"name": "TypeFox",
"url": "https://www.typefox.io"
Expand Down Expand Up @@ -74,6 +75,6 @@
],
"main": "./out/extension/main.cjs",
"bin": {
"ox-cli": "./out/cli/main.js"
"ox-cli": "out/cli/main.js"
}
}
19 changes: 10 additions & 9 deletions examples/ox/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "ox",
"displayName": "Ox",
"name": "typir-example-ox",
"displayName": "ox",
"version": "0.0.1",
"description": "Please enter a brief description here",
"private": true,
"description": "",
"author": {
"name": "TypeFox",
"url": "https://www.typefox.io"
Expand All @@ -27,11 +28,11 @@
"watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.json --watch\" \"node esbuild.mjs --watch\""
},
"dependencies": {
"commander": "~12.1.0",
"langium": "~3.2.0",
"typir-langium": "~0.0.1",
"vscode-languageclient": "~9.0.1",
"vscode-languageserver": "~9.0.1"
"commander": "~12.1.0",
"langium": "~3.2.0",
"typir-langium": "~0.0.1",
"vscode-languageclient": "~9.0.1",
"vscode-languageserver": "~9.0.1"
},
"devDependencies": {
"@types/vscode": "~1.94.0",
Expand Down Expand Up @@ -74,6 +75,6 @@
],
"main": "./out/extension/main.cjs",
"bin": {
"ox-cli": "./out/cli/main.js"
"ox-cli": "out/cli/main.js"
}
}
39 changes: 28 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"langium:generate": "npm run langium:generate --workspace=examples/ox --workspace=examples/lox",
"langium:watch": "npm run langium:watch --workspace=examples/ox --workspace=examples/lox",
"vscode:prepublish": "npm run build && npm run lint",
"reset:repo": "git clean -f -X -d"
"reset:repo": "git clean -f -X -d",
"version:dependencies": "node ./scripts/update-version.js && npm install"
},
"devDependencies": {
"@types/node": "~18.19.55",
Expand All @@ -38,6 +39,7 @@
"esbuild": "~0.24.0",
"eslint": "~8.57.1",
"eslint-plugin-header": "~3.1.1",
"fs-extra": "^11.2.0",
"shx": "~0.3.4",
"typescript": "~5.5.4",
"vitest": "~2.1.2"
Expand Down
140 changes: 0 additions & 140 deletions packages/typir-langium/package-lock.json

This file was deleted.

12 changes: 5 additions & 7 deletions packages/typir-langium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@
],
"files": [
"lib",
"src",
"node.js",
"node.d.ts",
"test.js",
"test.d.ts"
"src"
],
"scripts": {
"clean": "shx rm -rf lib out coverage",
"build": "tsc",
"watch": "tsc --watch",
"lint": "eslint src test --ext .ts"
"lint": "eslint src test --ext .ts",
"publish:next": "npm --no-git-tag-version version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" && npm publish --tag next",
"publish:latest": "npm publish --tag latest --access public"
},
"repository": {
"type": "git",
"url": "https://github.com/TypeFox/typir/",
"url": "git+https://github.com/TypeFox/typir.git",
"directory": "packages/typir-langium"
},
"bugs": "https://github.com/TypeFox/typir/issues",
Expand Down
Loading