From b7e21af25b4cd79028e2b026141e918e2f01e2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=2E=20Cofi=C3=B1o?= Date: Wed, 2 Oct 2024 11:59:35 +0200 Subject: [PATCH] Refactor GH action to use Makefile --- .github/workflows/adoc_build.yml | 36 ++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/adoc_build.yml b/.github/workflows/adoc_build.yml index c2c8a827..796d9861 100644 --- a/.github/workflows/adoc_build.yml +++ b/.github/workflows/adoc_build.yml @@ -43,30 +43,25 @@ jobs: steps: # Check out PR - uses: actions/checkout@v4 - # Create build directory - - run: mkdir conventions_build - - name: Set draft date-time formatting - if: github.event_name != 'release' - run: | - echo "DATE_FMT=+%d %B, %Y %H:%M:%SZ" >> "$GITHUB_ENV" - - name: Set "final" tag and date-time formatting + # If it is release event, tag for final + - name: Set "final" tag and date timestamp formatting if: github.event_name == 'release' run: | - echo "FINAL_TAG=-a final" >> "$GITHUB_ENV"; echo "DATE_FMT=+%d %B, %Y" >> "$GITHUB_ENV" + echo "CF_FINAL=True" >> "$GITHUB_ENV" # Build cf-conventions.html using the Analog-inc asciidoctor-action - name: Build cf-conventions.html - uses: Analog-inc/asciidoctor-action@v1.2 + uses: Analog-inc/asciidoctor-action@v1 with: - shellcommand: 'asciidoctor --verbose ${FINAL_TAG} -a docprodtime=$(date -u ${DATE_FMT}) -a data-uri cf-conventions.adoc -D conventions_build' + shellcommand: 'make conventions-html' # Patch the cfconventions.org link - run: sed -E -i 's+(See )(https://cfconventions.org)( for further information.)+\1\2\3+' ./conventions_build/cf-conventions.html # Build cf-conventions.pdf using the Analog-inc asciidoctor-action - name: Build cf-conventions.pdf - uses: Analog-inc/asciidoctor-action@v1.2 + uses: Analog-inc/asciidoctor-action@v1 with: - shellcommand: 'asciidoctor-pdf --verbose ${FINAL_TAG} -a docprodtime=$(date -u ${DATE_FMT}) -d book -a pdf-theme=default-theme-CF-version.yml --trace cf-conventions.adoc -D conventions_build' + shellcommand: 'make conventions-html' # Upload artifact containing cf-conventions.html, cf-conventions.pdf - - name: Upload cf-conventions doc preview + - name: Save cf-conventions doc preview uses: actions/upload-artifact@v4 with: name: conventions_docs @@ -80,22 +75,23 @@ jobs: - uses: actions/checkout@v4 # Create build directory - run: mkdir conformance_build - - name: Set "final" tag + # If it is release event, tag for final + - name: Set "final" tag and date timestamp formatting if: github.event_name == 'release' run: | - echo "FINAL_TAG=-a final" >> "$GITHUB_ENV" + echo "CF_FINAL=True" >> "$GITHUB_ENV" # Build conformance.html using the Analog-inc asciidoctor-action - name: Build conformance.html - uses: Analog-inc/asciidoctor-action@v1.2 + uses: Analog-inc/asciidoctor-action@v1 with: - shellcommand: 'asciidoctor --verbose ${FINAL_TAG} conformance.adoc -D conformance_build' + shellcommand: 'make conformance-html' # Build conformance.pdf using the Analog-inc asciidoctor-action - name: Build conformance.pdf - uses: Analog-inc/asciidoctor-action@v1.2 + uses: Analog-inc/asciidoctor-action@v1 with: - shellcommand: 'asciidoctor-pdf --verbose ${FINAL_TAG} -d book conformance.adoc -D conformance_build' + shellcommand: 'make conformance-pdf' # Upload artifact containing conformance.html, conformance.pdf - - name: Upload conformance doc preview + - name: Save conformance doc preview uses: actions/upload-artifact@v4 with: name: conformance_docs