Skip to content

Commit

Permalink
Merge branch 'package-ci' into 'master'
Browse files Browse the repository at this point in the history
hook up package publish via github ci for client and types

See merge request kchat/webapp!533
  • Loading branch information
antonbuks committed Sep 28, 2023
2 parents 701bb93 + c9d312f commit e9440a0
Show file tree
Hide file tree
Showing 11 changed files with 2,939 additions and 3,971 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches:
- master

jobs:
build_packages:
name: Build Packages and Publish to GitHub NPM Registry
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: 'https://npm.pkg.github.com'
scope: '@infomaniak'
- run: yarn
- run: yarn workspace @infomaniak/mattermost-client build
- run: yarn workspace @infomaniak/mattermost-types build
- run: yarn config set npmPublishRegistry https://npm.pkg.github.com
- run: yarn config set 'npmRegistries["//npm.pkg.github.com"].npmAuthToken' "$NPM_TOKEN"
- run: yarn config set 'npmRegistries["//npm.pkg.github.com"].npmAlwaysAuth' true
- run: yarn config set npmScopes.infomaniak.npmPublishRegistry https://npm.pkg.github.com
- run: yarn workspace @infomaniak/mattermost-client npm publish
- run: yarn workspace @infomaniak/mattermost-types npm publish
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35 changes: 33 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ build_front:
- export ENVIRONMENT=${DEPLOY_VARIABLE}
script:
- yarn
- yarn workspace @mattermost/types build
- yarn workspace @mattermost/client build
- yarn workspace @infomaniak/mattermost-types build
- yarn workspace @infomaniak/mattermost-client build
- yarn workspace @mattermost/components build
- yarn build:webapp
cache:
Expand All @@ -100,6 +100,37 @@ build_front:
expire_in: 1 days
when: always

publish_packages:
stage: build
image: node:16.10.0
tags:
- kubernetes
rules:
- if: $DEPLOY_VARIABLE == "prodsec"
when: on_success
- when: never
environment:
name: "$DEPLOY_VARIABLE"
script:
- yarn
- yarn workspace @infomaniak/mattermost-types build
- yarn workspace @infomaniak/mattermost-client build
- yarn config set npmPublishRegistry https://verdaccio.dev.infomaniak.ch
- yarn config set 'npmRegistries["//verdaccio.dev.infomaniak.ch"].npmAuthToken' "$VERDACCIO_TOKEN"
- yarn config set 'npmRegistries["//verdaccio.dev.infomaniak.ch"].npmAlwaysAuth' true
- yarn config set npmScopes.infomaniak.npmRegistryServer https://verdaccio.dev.infomaniak.ch
- yarn config set npmScopes.infomaniak.npmPublishRegistry https://verdaccio.dev.infomaniak.ch
- yarn config set npmScopes.infomaniak.npmAuthToken "$VERDACCIO_TOKEN"
- yarn workspace @infomaniak/mattermost-types npm publish
- yarn workspace @infomaniak/mattermost-client npm publish
cache:
key:
files:
- yarn.lock
paths:
- .yarn/cache/
- .yarn/install-state.gz

publish_front:
stage: release
tags:
Expand Down
11 changes: 6 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
nodeLinker: node-modules

npmScopes:
infomaniak:
npmAlwaysAuth: true
npmAuthToken: "${NPM_TOKEN}"
npmRegistryServer: "https://npm.pkg.github.com"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.2.2.cjs

npmScopes:
"infomaniak":
npmAlwaysAuth: true
npmRegistryServer: "https://verdaccio.dev.infomaniak.ch"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ We are using yarn berry with workspace tools for monorepo support building and b

```shell
yarn
yarn workspace @mattermost/types build
yarn workspace @mattermost/client build
yarn workspace @infomaniak/mattermost-types build
yarn workspace @infomaniak/mattermost-client build
yarn workspace @mattermost/components build
```

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"@giphy/js-fetch-api": "5.1.0",
"@giphy/react-components": "8.1.0",
"@guyplusplus/turndown-plugin-gfm": "1.0.7",
"@infomaniak/compass-components": "0.11.0",
"@infomaniak/compass-components": "0.12.0",
"@infomaniak/compass-icons": "0.10.0",
"@infomaniak/marked": "^0.2.0",
"@mattermost/client": "workspace:packages/client",
"@infomaniak/mattermost-client": "workspace:packages/client",
"@infomaniak/mattermost-types": "workspace:packages/types",
"@mattermost/components": "workspace:packages/components",
"@mattermost/types": "workspace:packages/types",
"@mui/base": "5.0.0-alpha.116",
"@mui/material": "5.11.7",
"@mui/styled-engine-sc": "5.11.0",
Expand Down
9 changes: 4 additions & 5 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
"name": "@mattermost/client",
"version": "7.9.0",
"name": "@infomaniak/mattermost-client",
"version": "7.9.0-nightly.1",
"description": "JavaScript/TypeScript client for Mattermost",
"keywords": [
"mattermost"
],
"homepage": "https://github.com/mattermost/mattermost-webapp/tree/master/packages/client#readme",
"homepage": "https://github.com/Infomaniak/kchat-webapp/tree/master/packages/client#readme",
"license": "MIT",
"files": [
"lib"
],
"main": "./lib/index.js",
"repository": {
"type": "git",
"url": "github:mattermost/mattermost-webapp",
"url": "github:infomaniak/kchat-webapp",
"directory": "packages/client"
},
"dependencies": {
"form-data": "4.0.0"
},
"devDependencies": {
"jest": "*",
"nock": "*",
"typescript": "^4.3"
},
"scripts": {
Expand Down
9 changes: 4 additions & 5 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es6",
"target": "es2022",
"declaration": true,
"strict": true,
"resolveJsonModule": true,
Expand All @@ -12,14 +12,13 @@
"jsx": "react",
"outDir": "./lib",
"rootDir": "./src",
"baseUrl": ".",
"typeRoots": ["../node_modules/@types"],
"types": ["@types/react"],
"paths": {
"@mattermost/types/*": ["../types/lib/*"]
}
},
"composite": true
},
"exclude": ["**/node_modules", "**/*.test.js", "**/*.test.ts"],
"exclude": ["**/node_modules", "**/*.test.*"],
"include": ["src/**/*.ts"],
"references": [
{"path": "../types"}
Expand Down
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@mattermost/components",
"private": true,
"module": "dist/index.esm.js",
"types": "dist/index.esm.d.ts",
"styles": "dist/index.esm.css",
Expand Down
8 changes: 4 additions & 4 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@mattermost/types",
"version": "7.9.0",
"name": "@infomaniak/mattermost-types",
"version": "7.9.0-nightly.1",
"description": "Shared type definitions used by the Mattermost web app",
"keywords": [
"mattermost"
],
"homepage": "https://github.com/mattermost/mattermost-webapp/tree/master/packages/types#readme",
"homepage": "https://github.com/Infomaniak/kchat-webapp/tree/master/packages/types#readme",
"license": "MIT",
"files": [
"lib"
Expand All @@ -16,7 +16,7 @@
"types": "./lib/*.d.ts",
"repository": {
"type": "git",
"url": "github:mattermost/mattermost-webapp",
"url": "github:infomaniak/kchat-webapp",
"directory": "packages/types"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ var config = {
'mattermost-redux': 'packages/mattermost-redux/src',
reselect: 'packages/reselect/src',
marked: '@infomaniak/marked',
'@mattermost/client': '@infomaniak/mattermost-client',
'@mattermost/types': '@infomaniak/mattermost-types',
'@mui/styled-engine': '@mui/styled-engine-sc',

// This alias restricts single version of styled components acros all packages
Expand Down
Loading

0 comments on commit e9440a0

Please sign in to comment.