Skip to content

Commit

Permalink
Add next release process
Browse files Browse the repository at this point in the history
  • Loading branch information
Lotes committed Feb 11, 2025
1 parent 3e92b82 commit 1b567b0
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish `latest`

permissions:
id-token: write
Expand All @@ -9,7 +9,7 @@ on:

jobs:
publish:
name: Typir Publish
name: Typir Publish `latest`
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish `next`

permissions:
id-token: write

on:
workflow_dispatch:

jobs:
publish:
name: Typir Publish `next`
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: Version as `next` packages
shell: bash
run: |
npm run version:next --workspace=typir
npm run version:next --workspace=typir-langium
npm run version:dependencies
- name: Publish NPM Packages
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run publish:next --provenance --workspace=typir
npm run publish:next --provenance --workspace=typir-langium
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Release Process

## `latest` releases

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.

1. Pull the latest changes from the main branch
Expand All @@ -17,3 +19,8 @@ The release process is mostly automated and requires running only a few commands
```

7. Create a [GitHub release](https://github.com/TypeFox/typir/releases) from the new tag (this will trigger the Github Action and publish all artifacts automatically).


## `next` releases

The release process for `next` releases is similar different from the `latest` releases. We configured a GitHub action to publish the `next` packages. It has to be called manually (it is a `workflow_dispatch`).
16 changes: 0 additions & 16 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions packages/typir-langium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
"build": "tsc",
"watch": "tsc --watch",
"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"
"version:next": "npm --no-git-tag-version version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\"",
"publish:latest": "npm publish --tag latest --access public",
"publish:next": "npm publish --tag next"
},
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions packages/typir/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
"build": "tsc",
"watch": "tsc --watch",
"lint": "eslint src test --ext .ts",
"publish:next": "npm --no-git-tag-version version \"$(npx semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\"",
"publish:latest": "npm publish --tag latest --access public"
"version:next": "npm --no-git-tag-version version \"$(npx semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\"",
"publish:latest": "npm publish --tag latest --access public",
"publish:next": "npm publish --tag next"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 1b567b0

Please sign in to comment.