Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github action automatically generate doc #67

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# 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
# 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
# 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/[email protected]
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/[email protected]
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-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 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-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/dmn-output/
cp -r ./output/ $GITHUB_WORKSPACE/dmn-output/

- name: cp-files-form
working-directory: ./${{ env.version }}/docs/userguide/src/${{ env.language }}/form/
run: |
ls -l
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.
# uses: meeDamian/github-release@7ae19492500104f636b3fee4d8103af0fed36c8e
uses: meeDamian/[email protected]
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>').
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: >
./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
# Set to 'true' to allow for release overriding.
allow_override: false