You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/04/22 05:15:51 UTC

[echarts] branch master updated: chore: pack RELEASE_NOTE.txt into src.zip

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ea1063  chore: pack RELEASE_NOTE.txt into src.zip
     new 9c9db6f  Merge pull request #14742 from pissang/enhaance-workflow
2ea1063 is described below

commit 2ea10636023c0ad4dbf743a70b998d18f2e34d5e
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Apr 22 12:44:12 2021 +0800

    chore: pack RELEASE_NOTE.txt into src.zip
---
 .github/workflows/source-release.yml            | 89 +++++++++++++------------
 build/source-release/prepareReleaseMaterials.js | 26 +++-----
 2 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/.github/workflows/source-release.yml b/.github/workflows/source-release.yml
index a9740d4..576cfae 100644
--- a/.github/workflows/source-release.yml
+++ b/.github/workflows/source-release.yml
@@ -5,7 +5,7 @@ on:
     types: [prereleased]
 
 jobs:
-  source:
+  materials:
     runs-on: ubuntu-latest
 
     strategy:
@@ -24,34 +24,34 @@ jobs:
         run: |
           echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
 
-      # TODO Check release version is RC
-      # TODO Release Note
+      - name: Cache node modules
+        uses: actions/cache@v2
+        env:
+          cache-name: cache-node-modules
+        with:
+          # npm cache files are stored in `~/.npm` on Linux/macOS
+          path: ~/.npm
+          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
 
-      # Archive before run others to avoid packing unkown files.
-      - name: Archive source release
+      - name: Prepare releaes materials
+        run: |
+          npm i
+          node build/source-release/prepareReleaseMaterials.js \
+            --rcversion ${{env.RELEASE_VERSION}} \
+            --commit ${{github.sha}} \
+            --repo ${{github.repository}} \
+            --out tmp/materials
+
+      - name: Archive materials
         uses: actions/upload-artifact@v2
         with:
-          name: apache-echarts-${{env.RELEASE_VERSION}}-src
+          name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials
           path: |
-            index.d.ts
-            src/
-            extension-src/
-            licenses/
-            theme/
-            build/
-            !build/source-release
-            package.json
-            package-lock.json
-            LICENSE
-            NOTICE
-            README.md
-            tsconfig.json
-            test/ut
-            test/types
-
+            tmp/materials/*
 
-  materials:
+  source:
     runs-on: ubuntu-latest
+    needs: materials
 
     strategy:
       matrix:
@@ -69,30 +69,37 @@ jobs:
         run: |
           echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
 
-      - name: Cache node modules
-        uses: actions/cache@v2
-        env:
-          cache-name: cache-node-modules
+      # Get RELEASE_NOTE.txt and pack it into zip.
+      - name: Download materials
+        uses: actions/download-artifact@v2
         with:
-          # npm cache files are stored in `~/.npm` on Linux/macOS
-          path: ~/.npm
-          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+          name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials
 
-      - name: Prepare releaes materials
-        run: |
-          npm i
-          node build/source-release/prepareReleaseMaterials.js \
-            --rcversion ${{env.RELEASE_VERSION}} \
-            --commit ${{github.sha}} \
-            --repo ${{github.repository}} \
-            --out tmp/materials
+      # TODO Check release version is RC
 
-      - name: Archive materials
+      # Archive before run others to avoid packing unkown files.
+      - name: Archive source release
         uses: actions/upload-artifact@v2
         with:
-          name: apache-echarts-${{env.RELEASE_VERSION}}-release-materials
+          name: apache-echarts-${{env.RELEASE_VERSION}}-src
           path: |
-            tmp/materials/*
+            index.d.ts
+            src/
+            extension-src/
+            licenses/
+            theme/
+            build/
+            !build/source-release
+            package.json
+            package-lock.json
+            LICENSE
+            NOTICE
+            README.md
+            tsconfig.json
+            test/ut
+            test/types
+            RELEASE_NOTE.txt
+
 
   validate-source:
     runs-on: ubuntu-latest
diff --git a/build/source-release/prepareReleaseMaterials.js b/build/source-release/prepareReleaseMaterials.js
index 939f12c..cb96d5e 100644
--- a/build/source-release/prepareReleaseMaterials.js
+++ b/build/source-release/prepareReleaseMaterials.js
@@ -125,21 +125,17 @@ https.get({
     });
     res.on('end', () => {
         let releaseNote = '';
-        try {
-            const releases = JSON.parse(rawData);
-            const found = releases.find(release => release.name === rcVersion);
-            if (!found) {
-                console.error('Can\'t found release');
-            }
-            else {
-                releaseNote = found.body.trim();
-                if (!releaseNote) {
-                    console.error('Release description is empty');
-                }
-            }
+
+        const releases = JSON.parse(rawData);
+        const found = releases.find(release => release.name === rcVersion);
+        if (!found) {
+            throw 'Can\'t found release';
         }
-        catch (e) {
-            console.error(e.message);
+        else {
+            releaseNote = found.body.trim();
+            if (!releaseNote) {
+                throw 'Release description is empty';
+            }
         }
 
         const firstLine = releaseNote.split('\n')[0];
@@ -155,5 +151,5 @@ https.get({
         );
     });
   }).on('error', (e) => {
-      console.error('Error', e);
+      throw e;
   });
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org