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

Hardcoded creation date-time replaced by attribute "docprodtime" #462

Conversation

larsbarring
Copy link
Contributor

N.B. Requires updates to the github workflow as suggested below.

See issue #457 for discussion of the changes.

Release checklist

  • [ NA] Authors updated in cf-conventions.adoc?
  • [ NA] Next version in cf-conventions.adoc up to date? Versioning inspired by SemVer.
  • [yes] history.adoc up to date?
  • [ NA] Conformance document up-to-date?

For maintainers

After the merge remember to delete the source branch.
Tags are set at the conclusion of the annual meeting; until then master always is a draft for the next version.

Replacing the hardcoded document creation date with an AsciiDoc attribute (with more flexible formatting than the builtin {localdatetime}) requires the format specification attribute to be set at the command line. The code changes below have not been tested in a github workflow, but the corresponding shell commands works when run locally.

... 
...
 - name: Set draft date-time formatting       ## new
      if github.event_name != 'release'       ## new
      run: |       ## new
        echo "DATE_FMT='+%d %B, %Y %H:%M:%SZ'" >> "$GITHUB_ENV"       ## new
 - name: Set "final" tag and date-time formatting       ## changed
      if: github.event_name == 'release'
      run: |
        echo "FINAL_TAG=-a final" >> "$GITHUB_ENV"; echo "DATE_FMT='+%d %B, %Y'" >> "$GITHUB_ENV"       ## changed
    # Build cf-conventions.html using the Analog-inc asciidoctor-action
    - name: Build cf-conventions.html
      uses: Analog-inc/[email protected]
      with:
        shellcommand: 'asciidoctor --verbose ${FINAL_TAG} -a docprodtime="$(date -u ${DATE_FMT})" cf-conventions.adoc -D conventions_build; cp -r images conventions_build'      ## changed
    # Build cf-conventions.pdf using the Analog-inc asciidoctor-action
    - name: Build cf-conventions.pdf
      uses: Analog-inc/[email protected]
      with:
        shellcommand: 'asciidoctor-pdf --verbose ${FINAL_TAG} -a docprodtime="$(date -u ${DATE_FMT})" -d book cf-conventions.adoc -D conventions_build'       ## changed
    # Upload artifact containing cf-conventions.html, cf-conventions.pdf

Could possibly someone from the Information Management and Support Team have a look at this?
ping e.g. @DocOtak, @sadielbartholomew, @cofinoa, @davidhassell

@larsbarring larsbarring force-pushed the automate_docment_production_date branch from 0d90131 to c4d9daf Compare October 16, 2023 20:04
@larsbarring larsbarring force-pushed the automate_docment_production_date branch from c4d9daf to 3e4f5db Compare November 1, 2023 11:40
@larsbarring larsbarring linked an issue Nov 6, 2023 that may be closed by this pull request
@larsbarring
Copy link
Contributor Author

I am closing this PR, but will shortly open a new one that includes the suggested changes to the workflow.

@larsbarring larsbarring closed this Nov 8, 2023
@larsbarring larsbarring deleted the automate_docment_production_date branch November 8, 2023 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation date of the draft Conventions document
1 participant