diff --git a/.github/cf-automation.yml b/.github/cf-automation.yml index 4732572..fc5d800 100644 --- a/.github/cf-automation.yml +++ b/.github/cf-automation.yml @@ -59,6 +59,7 @@ notice: - edited - closed paths: + - agreements/project-contribution/* - bylaws/* - policies/* label: ["!notice"] @@ -95,11 +96,11 @@ voting: - source: CONTACTS.yaml repo: commonhaus/foundation mapping: - - field: project - primary: + - field: project + primary: data: egc team: commonhaus/cf-egc - secondary: + secondary: data: egc-second team: commonhaus/cf-egc-second exclude_login: diff --git a/.github/docker-build-pdf.sh b/.github/docker-build-pdf.sh index d6e89e4..8a7d545 100755 --- a/.github/docker-build-pdf.sh +++ b/.github/docker-build-pdf.sh @@ -82,55 +82,29 @@ if [[ "${TO_CMD}" != "noargs" ]]; then fi # Convert markdown to PDF with an appended changelog -function to_pdf_pattern() { - local tmpout=output/tmp/${1} - shift - local pdfout=output/public/${1} - shift - local relative_path=${1} - shift - - mkdir -p "${tmpout}" - rm -f "${tmpout}"/* - rm -f "${pdfout}" - - # Use mounted volume paths - run_pdf --pdf-engine-opt=-output-dir="./${tmpout}" \ - --pdf-engine-opt=-outdir="./${tmpout}" \ - -o "./${pdfout}" \ - -V dirname:"${relative_path}" \ - "$@" -} - -# Convert markdown to PDF with an appended changelog -# to_pdf ./TRADEMARKS.md trademark-list ./ "Commonhaus Foundation Trademark List" +# working-dir is used to resolve resources in the file +# to_pdf pdf-basename cwd sources+args +# to_pdf trademark-list ./ sources+args +# to_pdf x ./policies sources+args +# to_pdf cf-bylaws ./bylaws sources+args function to_pdf() { - if [[ ! -f "${1}" ]]; then - echo "No source file found at ${1}" - exit 1 - fi - local source=${1} - shift local basename=${1} shift local relative_path=${1} shift - local title=${1} - shift - local tmpout=output/tmp/${basename} + local tmpout=./output/tmp/${basename} mkdir -p "${tmpout}" rm -f "${tmpout}"/* - local pdfout=output/public/${basename}.pdf + local pdfout=./output/public/${basename}.pdf rm -f "${pdfout}" # Use mounted volume paths - run_pdf --pdf-engine-opt=-output-dir="./${tmpout}" \ - --pdf-engine-opt=-outdir="./${tmpout}" \ - -o "./${pdfout}" \ - -M title:"${title}" \ + run_pdf --pdf-engine-opt=-output-dir="${tmpout}" \ + --pdf-engine-opt=-outdir="${tmpout}" \ -V dirname:"${relative_path}" \ - "${source}" + -o "${pdfout}" \ + "$@" } # Convert markdown to PDF @@ -150,11 +124,9 @@ function run_pdf() { function run_docx() { ${DOCKER} run ${ARGS} \ "${PANDOCK}" \ - -d ./.pandoc/agreements.yaml \ -M date-meta:"$(date +%B\ %d,\ %Y)" \ -V github:"${URL}" \ - -o "$1" \ - "$2" + "$@" echo "$?" } @@ -164,35 +136,21 @@ mkdir -p output/public ## BYLAWS -# Sorted order of files for Bylaws -BYLAWS=( - ./bylaws/1-preface.md - ./bylaws/2-purpose.md - ./bylaws/3-cf-membership.md - ./bylaws/4-cf-council.md - ./bylaws/5-cf-advisory-board.md - ./bylaws/6-decision-making.md - ./bylaws/7-notice-records.md - ./bylaws/8-indemnification-dissolution.md - ./bylaws/9-amendments.md -) - if [[ -z "${SKIP_BYLAWS}" ]]; then - # Verify that bylaws files exist - for x in "${BYLAWS[@]}"; do - if [[ ! -f ${x} ]]; then - echo "No file found at ${x}" - exit 1 - fi - done - - # # Convert bylaws to PDF - to_pdf_pattern \ - bylaws \ - "cf-bylaws.pdf" \ + # Convert bylaws to PDF + to_pdf \ + "cf-bylaws" \ "./bylaws/" \ - -M title:"Bylaws" \ - "${BYLAWS[@]}" + -M "title:Bylaws" \ + ./bylaws/1-preface.md \ + ./bylaws/2-purpose.md \ + ./bylaws/3-cf-membership.md \ + ./bylaws/4-cf-council.md \ + ./bylaws/5-cf-advisory-board.md \ + ./bylaws/6-decision-making.md \ + ./bylaws/7-notice-records.md \ + ./bylaws/8-indemnification-dissolution.md \ + ./bylaws/9-amendments.md fi ## POLICIES @@ -203,27 +161,34 @@ function to_policy_pdf() { echo "No policy found at ./policies/${1}.md" exit 1 fi - to_pdf_pattern \ + # to_pdf pdf-basename working-dir title ... whatever else + to_pdf \ "${1}" \ - "${1}.pdf" \ "./policies/" \ - -M title:"${2} Policy" \ + -M "title:${2} Policy" \ "./policies/${1}.md" } if [[ -z "${SKIP_POLICIES}" ]]; then - # Convert all policies to PDF - to_policy_pdf code-of-conduct "Code of Conduct" - to_policy_pdf conflict-of-interest "Conflict of Interest" - to_policy_pdf ip-policy "Intellectual Property" - to_policy_pdf trademark-policy "Trademark" - - to_pdf ./TRADEMARKS.md trademark-list ./ "Trademark List" + # Convert policies to PDF + # function source file (no extension)