diff --git a/.github/workflows/publish-ci.yml b/.github/workflows/publish-ci.yml new file mode 100644 index 0000000..e04ac2b --- /dev/null +++ b/.github/workflows/publish-ci.yml @@ -0,0 +1,72 @@ +name: Publish ModelHub Packages + +on: + workflow_run: + workflows: ['CI'] + types: + - completed + branches: [main] + workflow_dispatch: + +permissions: + contents: write + packages: write + id-token: write + +jobs: + verify-and-publish: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 # pulls all history and tags for Lerna to detect which packages changed + + - name: Setup Node 20 + uses: actions/setup-node@v4.0.4 + with: + node-version: 20.x + registry-url: 'https://registry.npmjs.org' + + - name: Install tools and libraries + run: sudo apt-get install -y build-essential libx11-dev libxkbfile-dev libsecret-1-dev + + - name: Use Python 3.11 + uses: actions/setup-python@v5.2.0 + with: + python-version: '3.11' + + - name: Install and Build + shell: bash + run: | + yarn global add node-gyp + yarn --skip-integrity-check --network-timeout 100000 + env: + NODE_OPTIONS: --max_old_space_size=4096 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build example applications + run: | + yarn browser build + yarn electron build + env: + NODE_OPTIONS: --max_old_space_size=4096 + + - name: Lint with ESLint + run: yarn lint + + - name: Run tests + run: yarn test + + # Publish the ModelHub packages. Ignore lifecycle scripts and add verbose logging + # Scripts are ignored because we build and lint before this step + - name: Publish packages + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + yarn lerna publish -y --ignore-scripts --loglevel=verbose + env: + NPM_CONFIG_PROVENANCE: 'true' + NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} diff --git a/ext/model-service-theia/package.json b/ext/model-service-theia/package.json index 23be7bb..0784ea9 100644 --- a/ext/model-service-theia/package.json +++ b/ext/model-service-theia/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x", diff --git a/lerna.json b/lerna.json index bc8814e..18152d7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,20 +1,21 @@ { "version": "independent", - "useNx": false, "npmClient": "yarn", "command": { "run": { "stream": true }, - "publish": { - "registry": "https://npm.pkg.github.com", - "message": "chore(release): publish release [skip ci]", + "version": { + "message": "chore: publish ModelHub packages", "conventionalCommits": true, + "changelog": false, "exact": true, "includeMergedTags": true, - "changelogPreset": "conventionalcommits", - "changelog": true, "private": false + }, + "publish": { + "npmClient": "npm", + "registry": "https://registry.npmjs.org/" } }, "ignoreChanges": ["**/*.md", "**/*.spec.ts", "**/*.spec.tsx"] diff --git a/npm/model-accessor-bus/package.json b/npm/model-accessor-bus/package.json index 756b155..03907eb 100644 --- a/npm/model-accessor-bus/package.json +++ b/npm/model-accessor-bus/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x", diff --git a/npm/model-manager/package.json b/npm/model-manager/package.json index c9f7cb5..6cb562f 100644 --- a/npm/model-manager/package.json +++ b/npm/model-manager/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x", diff --git a/npm/model-service/package.json b/npm/model-service/package.json index 4c6d6a7..bb41848 100644 --- a/npm/model-service/package.json +++ b/npm/model-service/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x", diff --git a/npm/model-validation/package.json b/npm/model-validation/package.json index 7280089..23955e6 100644 --- a/npm/model-validation/package.json +++ b/npm/model-validation/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x", diff --git a/npm/trigger-engine/package.json b/npm/trigger-engine/package.json index f6d4605..43905af 100644 --- a/npm/trigger-engine/package.json +++ b/npm/trigger-engine/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/eclipse-emfcloud/modelhub.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public" }, "engines": { "yarn": ">=1.7.0 <2.x.x",