From 0fae1e9982288fe743c1e0376383beb6f596e7a4 Mon Sep 17 00:00:00 2001 From: accia <1109903914@qq.com> Date: Fri, 26 Nov 2021 17:33:50 +0800 Subject: [PATCH 1/4] Create main.yml --- .github/workflows/main.yml | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..90a403a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,118 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +env: + language: en + version: V6.5.0 + ruby_version: 3.0.3 + module: bpmn +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + module: ['bpmn','cmmn','dmn','form'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Setup Ruby, JRuby and TruffleRuby + # You may pin to the exact commit or the version. + # uses: ruby/setup-ruby@cf1a6dd2d8563b59c7007e381836fd252ab2ac5b + uses: ruby/setup-ruby@v1.87.0 + with: + ruby-version: ${{ env.ruby_version }} + bundler-cache: true + working-directory: . + - name: Asciidoctor Setup + # You may pin to the exact commit or the version. + # uses: reitzig/actions-asciidoctor@7570212ae20b63653481675fb1ff62d1073632b0 + uses: reitzig/actions-asciidoctor@v2.0.0 + with: + Example: 2.0.10 + version: ~>2.0 + - name: Pygments install + run: gem install pygments.rb + - name: Asciidoctor-pdf install + run: gem install asciidoctor-pdf + - name: generate + working-directory: ./V6.5.0/docs/userguide/scripts/ + run: ./generate-all.sh ${{ matrix.module }} + + - name: cp-files + working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/${{ matrix.module }}/ + run: | + ls -l + mkdir $GITHUB_WORKSPACE/${{ matrix.module }}-output/ + cp -r ./output/ $GITHUB_WORKSPACE/${{ matrix.module }}-output/ + - name: package + working-directory: ./${{ matrix.module }}-output/output + run: | + # mkdir ${{runner.workspace}}/${{ matrix.module }}-output/output + tar -zcvf ${{ matrix.module }}.tar.gz ./* + ls -l + pwd +# mv ./${{ matrix.module }}.tar.gz ${{runner.workspace}}/${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + +# - name: Upload Release Asset +# id: upload-release-asset +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.create_release.outputs.upload_url }} +# asset_path: ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz +# asset_name: ${{ matrix.module }}.tar.gz +# - name: Upload a Build Artifact +# uses: actions/upload-artifact@v2 +# with: +# name: my-artifact +# path: | +# ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + + + - name: Github Release create, update, and upload assets + # You may pin to the exact commit or the version. + # uses: meeDamian/github-release@7ae19492500104f636b3fee4d8103af0fed36c8e + uses: meeDamian/github-release@v2.0.3 + with: + # Github API token to be used. Quite unavoidable, I'm afraid. + token: ${{ secrets.GITHUB_TOKEN }} + # A tag for the release. Required UNLESS action is run on tag push (meaning: '$GITHUB_REF' contains 'ref/tag/'). + + tag: ${{ env.version }} + #tag: # optional + # Unnecessary, if the tag provided is a git tag. If it isn't, release will be created off 'master'. + # commitish: # optional + # Name the release, the more creative, the better. + # name: # optional + # Longer description of the release, ex. changelog, or info about contributors. + # body: # optional + # Keep the Release as draft and don't publish it. With no 'files', the default is 'false'. With 'files' default is to 'un-draft' the release only after and if all assets upload successfully. Keep it private with explicit 'false'. + + # draft: # optional + # Marks Release as a pre-Release. + # prerelease: ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + # # A whitespace-separated(!) list of files to be uploaded. It's impossible to pass a list here, so make sure filenames don't contain spaces nor colons in their names/paths. Optionally custom asset name can be specified by pre-pending it to the name, ex: 'asset-name.tgz:./folder-to-be-uploaded/'. + files: > + ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + # Default is 'true', which compresses both files, and folders. 'false' compresses nothing, but will error out on folders, as they can't be uploaded. 'folders' applies compression to folders only. + gzip: false + # optional, default is true + # Set to 'true' to allow for release overriding. + allow_override: false From 55a689c20f76f3c143559580e9dc8d51ec23df90 Mon Sep 17 00:00:00 2001 From: accia <1109903914@qq.com> Date: Fri, 26 Nov 2021 17:36:31 +0800 Subject: [PATCH 2/4] Update main.yml --- .github/workflows/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90a403a..81b80e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,11 +5,6 @@ name: CI # Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: env: From 58b5c71dce6407cb8cad8bf8724d16313c62bba4 Mon Sep 17 00:00:00 2001 From: accia <1109903914@qq.com> Date: Fri, 26 Nov 2021 17:46:28 +0800 Subject: [PATCH 3/4] Update main.yml --- .github/workflows/main.yml | 97 +++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81b80e8..30e03e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,9 +18,9 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest - strategy: - matrix: - module: ['bpmn','cmmn','dmn','form'] +# strategy: +# matrix: +# module: ['bpmn','cmmn','dmn','form'] # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -45,41 +45,70 @@ jobs: run: gem install pygments.rb - name: Asciidoctor-pdf install run: gem install asciidoctor-pdf - - name: generate + + - name: generate-bpmn + working-directory: ./V6.5.0/docs/userguide/scripts/ + run: ./generate-all.sh bpmn + + - name: generate-cmmn + working-directory: ./V6.5.0/docs/userguide/scripts/ + run: ./generate-all.sh cmmn + + - name: generate-dmn working-directory: ./V6.5.0/docs/userguide/scripts/ - run: ./generate-all.sh ${{ matrix.module }} + run: ./generate-all.sh dmn + + - name: generate-form + working-directory: ./V6.5.0/docs/userguide/scripts/ + run: ./generate-all.sh form + + + - name: cp-files-bpmn + working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/bpmn/ + run: | + mkdir $GITHUB_WORKSPACE/bpmn-output/ + cp -r ./output/ $GITHUB_WORKSPACE/bpmn-output/ - - name: cp-files - working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/${{ matrix.module }}/ + - name: cp-files-cmmn + working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/cmmn/ + run: | + mkdir $GITHUB_WORKSPACE/cmmn-output/ + cp -r ./output/ $GITHUB_WORKSPACE/cmmn-output/ + + - name: cp-files-dmn + working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/dmn/ run: | ls -l - mkdir $GITHUB_WORKSPACE/${{ matrix.module }}-output/ - cp -r ./output/ $GITHUB_WORKSPACE/${{ matrix.module }}-output/ - - name: package - working-directory: ./${{ matrix.module }}-output/output + mkdir $GITHUB_WORKSPACE/dmn-output/ + cp -r ./output/ $GITHUB_WORKSPACE/dmn-output/ + + - name: cp-files-form + working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/form/ run: | - # mkdir ${{runner.workspace}}/${{ matrix.module }}-output/output - tar -zcvf ${{ matrix.module }}.tar.gz ./* ls -l - pwd -# mv ./${{ matrix.module }}.tar.gz ${{runner.workspace}}/${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz - -# - name: Upload Release Asset -# id: upload-release-asset -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# upload_url: ${{ needs.create_release.outputs.upload_url }} -# asset_path: ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz -# asset_name: ${{ matrix.module }}.tar.gz -# - name: Upload a Build Artifact -# uses: actions/upload-artifact@v2 -# with: -# name: my-artifact -# path: | -# ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + mkdir $GITHUB_WORKSPACE/form-output/ + cp -r ./output/ $GITHUB_WORKSPACE/form-output/ + + + - name: package-bpmn + working-directory: ./bpmn-output/output + run: | + tar -zcvf bpmn.tar.gz ./* + + - name: package-cmmn + working-directory: ./cmmn-output/output + run: | + tar -zcvf cmmn.tar.gz ./* + - name: package-dmn + working-directory: ./dmn-output/output + run: | + tar -zcvf dmn.tar.gz ./* + + - name: package-form + working-directory: ./form-output/output + run: | + tar -zcvf form.tar.gz ./* - name: Github Release create, update, and upload assets # You may pin to the exact commit or the version. @@ -89,7 +118,6 @@ jobs: # Github API token to be used. Quite unavoidable, I'm afraid. token: ${{ secrets.GITHUB_TOKEN }} # A tag for the release. Required UNLESS action is run on tag push (meaning: '$GITHUB_REF' contains 'ref/tag/'). - tag: ${{ env.version }} #tag: # optional # Unnecessary, if the tag provided is a git tag. If it isn't, release will be created off 'master'. @@ -105,7 +133,10 @@ jobs: # prerelease: ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz # # A whitespace-separated(!) list of files to be uploaded. It's impossible to pass a list here, so make sure filenames don't contain spaces nor colons in their names/paths. Optionally custom asset name can be specified by pre-pending it to the name, ex: 'asset-name.tgz:./folder-to-be-uploaded/'. files: > - ./${{ matrix.module }}-output/output/${{ matrix.module }}.tar.gz + ./bpmn-output/output/bpmn.tar.gz + ./cmmn-output/output/cmmn.tar.gz + ./dmn-output/output/dmn.tar.gz + ./form-output/output/form.tar.gz # Default is 'true', which compresses both files, and folders. 'false' compresses nothing, but will error out on folders, as they can't be uploaded. 'folders' applies compression to folders only. gzip: false # optional, default is true From d8b6333af404d5cde10649b35054983a612c103d Mon Sep 17 00:00:00 2001 From: accia <1109903914@qq.com> Date: Fri, 26 Nov 2021 17:57:53 +0800 Subject: [PATCH 4/4] add github action automatically generate doc add github action automatically generate doc. Auto publish github Releases --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30e03e8..f262bba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,9 +18,6 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest -# strategy: -# matrix: -# module: ['bpmn','cmmn','dmn','form'] # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it