From a0b442c10d83a3d3c9163853b4633a5bd0dbecce Mon Sep 17 00:00:00 2001 From: Stefan Cyliax Date: Tue, 17 May 2022 08:51:23 +0200 Subject: [PATCH 1/2] changed pipeline step of versioning to not use other image Signed-off-by: Stefan Cyliax --- .github/workflows/asciidoc-build.yml | 34 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/asciidoc-build.yml b/.github/workflows/asciidoc-build.yml index 37ed98c9..1064dcc6 100644 --- a/.github/workflows/asciidoc-build.yml +++ b/.github/workflows/asciidoc-build.yml @@ -3,16 +3,16 @@ name: AsciiDoc Documentation Build on: create: # new branches or tags release: # new releases - pull_request: + pull_request: branches: [ master ] push: # on push. This may be removed later schedule: # periodic - needed because some of the content is from the other repos - cron: '30 5,20 * * *' # this is pretty often. Only needed during review phase -jobs: +jobs: asciidoctor-build: name: Run Asciidoctor on Documentation - + runs-on: ubuntu-18.04 steps: @@ -30,7 +30,7 @@ jobs: repository: OpenSimulationInterface/open-simulation-interface path: open-simulation-interface fetch-depth: 0 - + - name: Checkout OSI Sensor Model Packaging uses: actions/checkout@v2 @@ -49,36 +49,42 @@ jobs: id: get_version working-directory: open-simulation-interface run: echo ::set-output name=VERSION::$(git describe --always) - + - name: Apply versioning to Adoc - uses: jacobtomlinson/gha-find-replace@master - with: - find: ":revnumber: --localbuild--" - replace: ":revnumber: master (${{ steps.get_version.outputs.VERSION }})" - include: "index.adoc" + # uses: jacobtomlinson/gha-find-replace@master + # with: + # find: ":revnumber: --localbuild--" + # replace: ":revnumber: master (${{ steps.get_version.outputs.VERSION }})" + # include: "index.adoc" + run: | + grep ":revnumber:" index.adoc + sed -i -e "s/--localbuild--/master (${{ steps.get_version.outputs.VERSION }})/" index.adoc + grep ":revnumber:" index.adoc + + - name: Remove docdate for online hosted document run: sed 's/^:revdate:.*/:!revdate:/' index.adoc - + # run Asciidoctor - name: Build HTML uses: avattathil/asciidoctor-action@master with: program: "asciidoctor -D . --failure-level WARN -r asciidoctor-diagram -r asciidoctor-bibtex -a mathjax --trace --backend=html5 index.adoc -o open-simulation-interface_V${{ steps.get_version.outputs.VERSION }}.html" - # Upload artifact. + # Upload artifact. - name: Upload HTML Artifact uses: actions/upload-artifact@v2 if: ${{ github.event_name == 'pull_request' }} with: name: HTML document path: open-simulation-interface_V${{ steps.get_version.outputs.VERSION }}.html - if-no-files-found: error + if-no-files-found: error # Publish the artifact when pipeline runs on master - name: rename file for deploy to gh-page if: ${{ github.ref == 'refs/heads/master' }} - run: | + run: | mkdir html/ cp open-simulation-interface_V${{ steps.get_version.outputs.VERSION }}.html html/index.html From 66eab23f131504e9fa52c9c03a463057bc01cd20 Mon Sep 17 00:00:00 2001 From: Stefan Cyliax Date: Tue, 17 May 2022 09:03:31 +0200 Subject: [PATCH 2/2] Cleanup Signed-off-by: Stefan Cyliax --- .github/workflows/asciidoc-build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/asciidoc-build.yml b/.github/workflows/asciidoc-build.yml index 1064dcc6..4e44ea48 100644 --- a/.github/workflows/asciidoc-build.yml +++ b/.github/workflows/asciidoc-build.yml @@ -50,19 +50,13 @@ jobs: working-directory: open-simulation-interface run: echo ::set-output name=VERSION::$(git describe --always) + # replaces the placeholder for versioning in the main mapping file - name: Apply versioning to Adoc - # uses: jacobtomlinson/gha-find-replace@master - # with: - # find: ":revnumber: --localbuild--" - # replace: ":revnumber: master (${{ steps.get_version.outputs.VERSION }})" - # include: "index.adoc" run: | grep ":revnumber:" index.adoc sed -i -e "s/--localbuild--/master (${{ steps.get_version.outputs.VERSION }})/" index.adoc grep ":revnumber:" index.adoc - - - name: Remove docdate for online hosted document run: sed 's/^:revdate:.*/:!revdate:/' index.adoc