From 5f1246280ca50ccbbb5e874ea8bc8885b04156bf Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 15 Oct 2019 22:43:36 +0200 Subject: [PATCH 01/16] Added alpha release build ci --- .github/workflows/alpha-release-build.yml | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/alpha-release-build.yml diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml new file mode 100644 index 000000000..05c555c55 --- /dev/null +++ b/.github/workflows/alpha-release-build.yml @@ -0,0 +1,34 @@ +name: Build alpha release package + +on: push +#on: +# push: +# branches: +# - 'release/**' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install Yarn + run: npm i yarn --global + + - name: Install Packages + run: yarn install + + - name: Build + run: yarn build + + - name: Test + run: yarn test + + - name: E2E Test + run: yarn e2e From 6a33ac05a3cf01785e72ff7c1cff19108ea14bea Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 15 Oct 2019 23:11:22 +0200 Subject: [PATCH 02/16] workflow adjusts --- .github/workflows/alpha-release-build.yml | 13 +++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index 05c555c55..a91caa331 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -32,3 +32,16 @@ jobs: - name: E2E Test run: yarn e2e + + - name: E2E Test + run: yarn e2e + + - name: Publish + run: | + VERSION=$(echo ${{github.ref}} | tail -c +9) + echo $VERSION + npm version --no-git-tag-version $VERSION + npm login --registry=https://npm.pkg.github.com/ + npm config set registry https://npm.pkg.github.com/knsv + npm publish --tag alpha --dry-run + diff --git a/package-lock.json b/package-lock.json index 4fc945363..bcffa9ac2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.3.1", + "version": "8.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 76c65dd3a..d6338dd12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.3.1", + "version": "8.4.0", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid.core.js", "keywords": [ From 7e6b43236a7f96c05614733d4abcda400b9462a5 Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 15 Oct 2019 23:19:05 +0200 Subject: [PATCH 03/16] testing --- .github/workflows/alpha-release-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index a91caa331..d90e0324c 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -27,14 +27,14 @@ jobs: - name: Build run: yarn build - - name: Test - run: yarn test + #- name: Test + # run: yarn test - - name: E2E Test - run: yarn e2e + #- name: E2E Test + # run: yarn e2e - - name: E2E Test - run: yarn e2e + #- name: E2E Test + # run: yarn e2e - name: Publish run: | From 61b4c6d3ac9fd95378d3459403daa91d5f19381a Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 15 Oct 2019 23:24:13 +0200 Subject: [PATCH 04/16] testing --- .github/workflows/alpha-release-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index d90e0324c..741141a45 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -14,7 +14,7 @@ jobs: node-version: [10.x] steps: - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} + - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} @@ -38,7 +38,8 @@ jobs: - name: Publish run: | - VERSION=$(echo ${{github.ref}} | tail -c +9) + # VERSION=$(echo ${{github.ref}} | tail -c +20) + VERSION=8.4.0 echo $VERSION npm version --no-git-tag-version $VERSION npm login --registry=https://npm.pkg.github.com/ From 56e9abfc92b411303bc5818d6085b4e076067532 Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Tue, 15 Oct 2019 23:28:16 +0200 Subject: [PATCH 05/16] testing --- .github/workflows/alpha-release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index 741141a45..967afad56 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -41,7 +41,7 @@ jobs: # VERSION=$(echo ${{github.ref}} | tail -c +20) VERSION=8.4.0 echo $VERSION - npm version --no-git-tag-version $VERSION + npm version --no-git-tag-version --allow-same-version $VERSION npm login --registry=https://npm.pkg.github.com/ npm config set registry https://npm.pkg.github.com/knsv npm publish --tag alpha --dry-run From af57da8e6b553790d2c3e63ff94fc6479ba58dda Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 02:40:09 +0200 Subject: [PATCH 06/16] testing --- .github/workflows/alpha-release-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index 967afad56..a53762c8c 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -42,6 +42,7 @@ jobs: VERSION=8.4.0 echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION + npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN npm login --registry=https://npm.pkg.github.com/ npm config set registry https://npm.pkg.github.com/knsv npm publish --tag alpha --dry-run From 3073b6559cd340d2c42ac29205659792459d32de Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 02:44:22 +0200 Subject: [PATCH 07/16] testing --- .github/workflows/alpha-release-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index a53762c8c..c8fcfc5b0 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -43,7 +43,6 @@ jobs: echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN - npm login --registry=https://npm.pkg.github.com/ - npm config set registry https://npm.pkg.github.com/knsv + npm set registry https://npm.pkg.github.com/knsv npm publish --tag alpha --dry-run From 42aeafc907b1d3fcec9561393bce89e80a09288d Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 02:54:11 +0200 Subject: [PATCH 08/16] testing --- .github/workflows/alpha-release-build.yml | 18 +++--------------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index c8fcfc5b0..faaafcf2d 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -24,25 +24,13 @@ jobs: - name: Install Packages run: yarn install - - name: Build - run: yarn build - - #- name: Test - # run: yarn test - - #- name: E2E Test - # run: yarn e2e - - #- name: E2E Test - # run: yarn e2e - - name: Publish run: | - # VERSION=$(echo ${{github.ref}} | tail -c +20) - VERSION=8.4.0 + # VERSION=$(echo ${{github.ref}} | tail -c +20)-preview + VERSION=8.4.0-preview echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN npm set registry https://npm.pkg.github.com/knsv - npm publish --tag alpha --dry-run + npm publish --dry-run diff --git a/package-lock.json b/package-lock.json index bcffa9ac2..44347a545 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.4.0", + "version": "8.4.0-preview", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d6338dd12..1dc029475 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.4.0", + "version": "8.4.0-preview", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid.core.js", "keywords": [ From 6e088d17fd41f24bd24357b26010dba8880c7468 Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 03:15:33 +0200 Subject: [PATCH 09/16] testing --- .github/workflows/alpha-release-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/alpha-release-build.yml index faaafcf2d..a851a457a 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/alpha-release-build.yml @@ -26,8 +26,9 @@ jobs: - name: Publish run: | - # VERSION=$(echo ${{github.ref}} | tail -c +20)-preview - VERSION=8.4.0-preview + # VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION + PREVIEW_VERSION=$(git rev-list --count --first-parent HEAD) + VERSION=8.4.0-preview.$PREVIEW_VERSION echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN From d95a9469ac46b80048424a67ff47049aea0e474f Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 03:23:22 +0200 Subject: [PATCH 10/16] testing --- ...{alpha-release-build.yml => release-preview-publish.yml} | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{alpha-release-build.yml => release-preview-publish.yml} (92%) diff --git a/.github/workflows/alpha-release-build.yml b/.github/workflows/release-preview-publish.yml similarity index 92% rename from .github/workflows/alpha-release-build.yml rename to .github/workflows/release-preview-publish.yml index a851a457a..697d05ff3 100644 --- a/.github/workflows/alpha-release-build.yml +++ b/.github/workflows/release-preview-publish.yml @@ -1,4 +1,4 @@ -name: Build alpha release package +name: Publish release preview package on: push #on: @@ -7,7 +7,7 @@ on: push # - 'release/**' jobs: - build: + publish: runs-on: ubuntu-latest strategy: matrix: @@ -33,5 +33,5 @@ jobs: npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN npm set registry https://npm.pkg.github.com/knsv - npm publish --dry-run + npm publish diff --git a/package.json b/package.json index 1dc029475..76c65dd3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.4.0-preview", + "version": "8.3.1", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid.core.js", "keywords": [ From f0bbb063dda5017171257a7889f7191778bc6c29 Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 03:34:22 +0200 Subject: [PATCH 11/16] testing --- .github/workflows/release-preview-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 697d05ff3..5693890d7 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -21,6 +21,9 @@ jobs: - name: Install Yarn run: npm i yarn --global + - name: Install Json + run: npm i json --global + - name: Install Packages run: yarn install @@ -33,5 +36,6 @@ jobs: npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN npm set registry https://npm.pkg.github.com/knsv + json -I -f package.json -e 'this.name="@knsv/mermaid"' # Package name needs to be set to a scoped one because GitHub registry requires this npm publish From 49f5b8d150fdb8e304405f5e4811e0cd2d91d79a Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 03:42:37 +0200 Subject: [PATCH 12/16] testing --- .github/workflows/release-preview-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 5693890d7..73c38fd6d 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -37,5 +37,6 @@ jobs: npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN npm set registry https://npm.pkg.github.com/knsv json -I -f package.json -e 'this.name="@knsv/mermaid"' # Package name needs to be set to a scoped one because GitHub registry requires this + json -I -f package.json -e 'this.repository="git://github.com/knsv/mermaid"' # Repo url needs to have a specific format too npm publish From 04f86ef13000f1bcbd711bc0bcc3f1bdaf66f3fb Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 21:50:06 +0200 Subject: [PATCH 13/16] testing --- .github/workflows/release-preview-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 73c38fd6d..931dce76c 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -34,7 +34,7 @@ jobs: VERSION=8.4.0-preview.$PREVIEW_VERSION echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION - npm set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN + npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} npm set registry https://npm.pkg.github.com/knsv json -I -f package.json -e 'this.name="@knsv/mermaid"' # Package name needs to be set to a scoped one because GitHub registry requires this json -I -f package.json -e 'this.repository="git://github.com/knsv/mermaid"' # Repo url needs to have a specific format too From 2348f9d785593d6970177ef3b4991ae247032ac6 Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 21:57:35 +0200 Subject: [PATCH 14/16] finished ci --- .github/workflows/release-preview-publish.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-preview-publish.yml b/.github/workflows/release-preview-publish.yml index 931dce76c..552452e80 100644 --- a/.github/workflows/release-preview-publish.yml +++ b/.github/workflows/release-preview-publish.yml @@ -1,10 +1,9 @@ name: Publish release preview package -on: push -#on: -# push: -# branches: -# - 'release/**' +on: + push: + branches: + - 'release/**' jobs: publish: @@ -29,9 +28,8 @@ jobs: - name: Publish run: | - # VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION PREVIEW_VERSION=$(git rev-list --count --first-parent HEAD) - VERSION=8.4.0-preview.$PREVIEW_VERSION + VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION echo $VERSION npm version --no-git-tag-version --allow-same-version $VERSION npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} From 8e1672568a666afaae07ba713b70e4b8913eb32a Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 22:09:33 +0200 Subject: [PATCH 15/16] added preview builds to readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b7372ce37..0d3e6c394 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,20 @@ Example: https://unpkg.com/mermaid@7.1.0/dist/ yarn add mermaid +### Preview builds +Preview builds are created automatically for each release. They can be found in the [GitHub registry](https://github.com/knsv/mermaid/packages). +Make sure to configure npm to use the GitHub package registry. Steps for that can be found [here](https://help.github.com/en/articles/configuring-npm-for-use-with-github-package-registry). + +If you want to get the latest preview for the next release +``` +yarn add @knsv/mermaid +``` + + +If you want to get the latest preview for a specific version +``` +yarn add @knsv/mermaid@ +``` ## Documentation From 016dc17d946e0b4ebb005c534147aee85a74479a Mon Sep 17 00:00:00 2001 From: Christian Klemm Date: Wed, 16 Oct 2019 22:16:25 +0200 Subject: [PATCH 16/16] clean up branch --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 44347a545..4fc945363 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "8.4.0-preview", + "version": "8.3.1", "lockfileVersion": 1, "requires": true, "dependencies": {