Skip to content

Start with three colons #80

Start with three colons

Start with three colons #80

name: Build Draft Guidelines
on: [push, pull_request, workflow_dispatch]
jobs:
build_docs:
permissions:
contents: write
strategy:
matrix:
document:
- 'BR'
- 'CS'
- 'EVG'
- 'SMIME'
- 'TLS'
name: Build ${{ matrix.document }}
runs-on: ubuntu-20.04
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout old version for redline
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha || github.event.push.before }}
fetch-depth: 0
path: old/
- uses: docker://ghcr.io/vanbroup/build-guidelines-action:latest
id: build_doc
with:
markdown_file: output/${{ matrix.document }}.md
diff_file: old/output/${{ matrix.document }}.md
pdf: true
docx: true
lint: true
draft: ${{ !(github.event_name == 'push' && github.repository == 'cabforum/servercert' && github.ref == 'refs/heads/main') }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.document }}-${{ steps.build_doc.outputs.file_version }}-${{ github.event.pull_request.head.sha || github.sha }}-${{ github.event_name }}.zip
path: |
${{ steps.build_doc.outputs.pdf_file }}
${{ steps.build_doc.outputs.docx_file }}
${{ steps.build_doc.outputs.pdf_redline_file }}
if-no-files-found: 'error'
# TODO: Split of the following into a separate job (and move permissions to that job)
# --notes-from-tag ${{ steps.build_doc.outputs.diff_version }} \
- name: Creates a release in GitHub and uploads final document and redline
#if: github.event.pull_request.base.ref == 'main' && github.event_name == 'push'
run: |
echo "${{ toJSON(steps.build_doc.outputs) }}"
gh release create ${{ format('{0}{1}', matrix.document, steps.build_doc.outputs.file_version) }} \
${{ steps.build_doc.outputs.pdf_file }} \
${{ steps.build_doc.outputs.pdf_redline_file }} \
--title "${{ matrix.document }} ${{ steps.build_doc.outputs.file_version }}" \
--notes "${{ steps.build_doc.outputs.changelog }}" \
--draft
env:
GITHUB_TOKEN: ${{ github.TOKEN }}