Skip to content

Commit

Permalink
JDF-1045 Align all build scripts etc with updated build chain
Browse files Browse the repository at this point in the history
  • Loading branch information
TBPLtd committed Jan 31, 2024
1 parent e09eae8 commit 02077ef
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 86 deletions.
199 changes: 199 additions & 0 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# This is the basic workflow to build draft release documentation
# Draft releases allow WG to 'tag' a particular state of the repository and equivalent
# PDF. Useful if a document is to be discussed at an interop, but continues to be edited

# !NOTE:
# This build produces multiple versions of this document!!
name: Draft Release Build
## This section contains ALL variable specific for this project ##
# The VERSION is the main release number i.e. 1.7 or 2.1
env:
# Common to all builds
BUILD_NAME: ICS-XJDF-QUALITYCONTROL
DOCUMENT_VERSION: '2.2'
# 'BOTH' version is not built for release documents
#
# 'Customer' parameters
CUST_DOCUMENT_COVER_TITLE: Quality Control Customer ICS
CUST_CONFIG_FILE: Build\ICS_XJDF_QualityControl_Customer.ini
CUST_CONFLUENCE_LABELS: 'ics-xjdf-qualitycontrol-customer,milestone'
# 'MIS' parameters
MIS_DOCUMENT_COVER_TITLE: Quality Control MIS ICS
MIS_CONFIG_FILE: Build\ICS_XJDF_QualityControl_MIS.ini
MIS_CONFLUENCE_LABELS: 'ics-xjdf-qualitycontrol-mis,milestone'
# Same ID for all builds
CONFLUENCE_ID: '1560313992'

# Common metadata to all builds
DOCUMENT_METADATA_COPYRIGHT: 'CIP4 Organization, all rights reserved'

# 'Customer' metadata
CUST_DOCUMENT_METADATA_TITLE: 'Quality Control Customer ICS'

# 'MIS' metadata
MIS_DOCUMENT_METADATA_TITLE: 'Quality Control MIS ICS'

BUILD_UTILITY_EXE: c:\actions-runner\_work\_tool\document-processing\document-processing.exe

## The remaining section is based upon those common to all draft documentation builds
## It has been modified to allow for three slightly different builds.

# Controls when the action will run
on:
push:
tags:
- 'Draft*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_customer:
runs-on: [framemaker-2020]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# For access to other Git repositories - an access token is required.
- name: Get GitHub Access Token
id: access_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.CIP4_GITHUB_ACTIONS_APP_ID }}
private_key: ${{ secrets.CIP4_GITHUB_ACTIONS_APP_KEY }}

# Clean up working directory
- name: Clean up working directory
run: rm -r -fo *

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout source
uses: actions/checkout@v2
with:
path: document

# Check out the build scripts
- name: Checkout build scripts
uses: actions/checkout@v2
with:
repository: cip4/cip4-document-builder
token: ${{ steps.access_token.outputs.token }}
path: builder

# Build the document parameters
- name: Build Document
timeout-minutes: 30
run: >
python ..\builder\scripts\specbuilder.py $env:CUST_CONFIG_FILE
"$env:CUST_DOCUMENT_COVER_TITLE $env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:CUST_DOCUMENT_COVER_TITLE"
"$env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:CUST_DOCUMENT_METADATA_TITLE $env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
"2000-$((Get-Date).ToString('yyyy'))"
"Run-$env:GITHUB_RUN_NUMBER"
working-directory: ./document

# Mark pages with draft watermark
- name: Watermark pages
run: >
${{ env.BUILD_UTILITY_EXE }} draft "$env:CUST_DOCUMENT_COVER_TITLE*.pdf"
working-directory: ./document/target

# Upload any artefact produced.
- name: Upload Document
uses: actions/upload-artifact@v2
with:
name: ${{ env.BUILD_NAME }}-artifact
path: document/target/*.pdf

# Generate full Confluence Labels List
- name: Generate Full Confluence Labels List
run: >
echo "FULL_CONFLUENCE_LABELS=${env:CUST_CONFLUENCE_LABELS},$(${env:GITHUB_REF}.replace('refs/tags/',''))" |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Upload to Confluence
- name: Confluence Upload
uses: cip4/action-confluence-upload@master
with:
url: 'https://cip4.atlassian.net/wiki'
username: ${{ secrets.ATLASSIAN_USER }}
password: ${{ secrets.ATLASSIAN_TOKEN }}
contentId: ${{ env.CONFLUENCE_ID }}
label: ${{ env.FULL_CONFLUENCE_LABELS }}
filePattern: 'document/target/*.pdf'

build_mis:
runs-on: [framemaker-2020]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# For access to other Git repositories - an access token is required.
- name: Get GitHub Access Token
id: access_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.CIP4_GITHUB_ACTIONS_APP_ID }}
private_key: ${{ secrets.CIP4_GITHUB_ACTIONS_APP_KEY }}

# Clean up working directory
- name: Clean up working directory
run: rm -r -fo *

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout source
uses: actions/checkout@v2
with:
path: document

# Check out the build scripts
- name: Checkout build scripts
uses: actions/checkout@v2
with:
repository: cip4/cip4-document-builder
token: ${{ steps.access_token.outputs.token }}
path: builder

# Build the release document - note: no cover version required, part of cover title.
- name: Build Document
timeout-minutes: 30
run: >
python ..\builder\scripts\specbuilder.py $env:MIS_CONFIG_FILE
"$env:MIS_DOCUMENT_COVER_TITLE $env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:MIS_DOCUMENT_COVER_TITLE"
"$env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:MIS_DOCUMENT_METADATA_TITLE $env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:DOCUMENT_VERSION $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
"2000-$((Get-Date).ToString('yyyy'))"
"Run-$env:GITHUB_RUN_NUMBER"
working-directory: ./document

# Mark pages with draft watermark
- name: Watermark pages
run: >
${{ env.BUILD_UTILITY_EXE }} draft "$env:CUST_DOCUMENT_COVER_TITLE*.pdf"
working-directory: ./document/target

# Upload any artefact produced.
- name: Upload Document
uses: actions/upload-artifact@v2
with:
name: ${{ env.BUILD_NAME }}-artifact
path: document/target/*.pdf

# Generate full Confluence Labels List
- name: Generate Full Confluence Labels List
run: >
echo "FULL_CONFLUENCE_LABELS=${env:MIS_CONFLUENCE_LABELS},$(${env:GITHUB_REF}.replace('refs/tags/',''))" |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Upload to Confluence
- name: Confluence Upload
uses: cip4/action-confluence-upload@master
with:
url: 'https://cip4.atlassian.net/wiki'
username: ${{ secrets.ATLASSIAN_USER }}
password: ${{ secrets.ATLASSIAN_TOKEN }}
contentId: ${{ env.CONFLUENCE_ID }}
label: ${{ env.FULL_CONFLUENCE_LABELS }}
filePattern: 'document/target/*.pdf'
51 changes: 17 additions & 34 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ env:
MIS_CONFLUENCE_LABELS: 'ics-xjdf-qualitycontrol-mis,milestone'
# Same ID for all builds
CONFLUENCE_ID: '1560313992'

# Common metadata to all builds
DOCUMENT_METADATA_COPYRIGHT: 'CIP4 Organization, all rights reserved'
DOCUMENT_METADATA_AUTHOR: 'CIP4 Organization'
DOCUMENT_METADATA_KEYWORDS: 'Automation;CIM;CIP4;Graphic Arts;Graphics;Interface;Printing;Specification;Standard;Workflow;XML'
DOCUMENT_METADATA_COPYRIGHT: 'CIP4 Organization, all rights reserved'

# 'Customer' metadata
CUST_DOCUMENT_METADATA_TITLE: 'Quality Control Customer ICS'
CUST_DOCUMENT_METADATA_SUBJECT: 'Quality Control Customer Interoperability Conformance Specification for JDF'

# 'MIS' metadata
MIS_DOCUMENT_METADATA_TITLE: 'Quality Control MIS ICS'
MIS_DOCUMENT_METADATA_SUBJECT: 'Quality Control MIS Interoperability Conformance Specification for JDF'

BUILD_UTILITY_EXE: c:\actions-runner\_work\_tool\document-processing\document-processing.exe

Expand All @@ -41,7 +40,7 @@ env:
on:
push:
tags:
- '*'
- '2*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -82,23 +81,15 @@ jobs:
run: >
python ..\builder\scripts\specbuilder.py $env:CUST_CONFIG_FILE
"$env:CUST_DOCUMENT_COVER_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:CUST_DOCUMENT_COVER_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
" "
"$env:CUST_DOCUMENT_COVER_TITLE"
"Release: $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:CUST_DOCUMENT_METADATA_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
"2000-$((Get-Date).ToString('yyyy'))"
"Run-$env:GITHUB_RUN_NUMBER"
working-directory: ./document

# Update document meta-data properties
- name: Update Document Metadata
run: >
${{ env.BUILD_UTILITY_EXE }} info "$env:CUST_DOCUMENT_COVER_TITLE*.pdf"
--copyright "$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
--title "$env:CUST_DOCUMENT_METADATA_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
--subject "$env:CUST_DOCUMENT_METADATA_SUBJECT"
--author "$env:DOCUMENT_METADATA_AUTHOR"
--keywords "$env:DOCUMENT_METADATA_KEYWORDS"
--version "$(${env:GITHUB_REF}.replace('refs/tags/',''))"
working-directory: ./document/target

# Upload any artefact produced.
- name: Upload Document
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -160,23 +151,15 @@ jobs:
run: >
python ..\builder\scripts\specbuilder.py $env:MIS_CONFIG_FILE
"$env:MIS_DOCUMENT_COVER_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:MIS_DOCUMENT_COVER_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
" "
"$env:MIS_DOCUMENT_COVER_TITLE"
"Release: $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$env:MIS_DOCUMENT_METADATA_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$(${env:GITHUB_REF}.replace('refs/tags/',''))"
"$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
"2000-$((Get-Date).ToString('yyyy'))"
"Run-$env:GITHUB_RUN_NUMBER"
working-directory: ./document

# Update document meta-data properties
- name: Update Document Metadata
run: >
${{ env.BUILD_UTILITY_EXE }} info "$env:MIS_DOCUMENT_COVER_TITLE*.pdf"
--copyright "$((Get-Date).ToString('MMMM yyyy')) $env:DOCUMENT_METADATA_COPYRIGHT"
--title "$env:MIS_DOCUMENT_METADATA_TITLE $(${env:GITHUB_REF}.replace('refs/tags/',''))"
--subject "$env:MIS_DOCUMENT_METADATA_SUBJECT"
--author "$env:DOCUMENT_METADATA_AUTHOR"
--keywords "$env:DOCUMENT_METADATA_KEYWORDS"
--version "$(${env:GITHUB_REF}.replace('refs/tags/',''))"
working-directory: ./document/target

# Upload any artefact produced.
- name: Upload Document
uses: actions/upload-artifact@v2
Expand Down
Loading

0 comments on commit 02077ef

Please sign in to comment.