Skip to content

Commit

Permalink
Merge pull request #31 from jtxa/ci-msys-doc-gitattributes
Browse files Browse the repository at this point in the history
CI: Add MSYS2 zip package in github workflow
  • Loading branch information
sierrafoxtrot authored Nov 12, 2022
2 parents 9d54e51 + 0a6c49b commit cf963da
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 10 deletions.
14 changes: 12 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ max_line_length = 120
tab_width = 8
trim_trailing_whitespace = true

[*.{html,man,so}]
max_line_length = 400

# Sources
[*.{cc,h,h.in}]
max_line_length = 80

[*.{html,man,so}]
max_line_length = 400
# Documentation files processed by groff
[*.{1,3,5,html,lsm,man,so}]
end_of_line = lf

# Script files
[*.{awk,sh}]
end_of_line = lf

# YAML configuration files
[*.{yaml,yml,clang-tidy}]
indent_size = 2
tab_width = 2
Expand Down
24 changes: 24 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Enable default behaviour
* text=auto

# Sources
*.cc text diff=cpp
*.h text diff=cpp
*.h.in text diff=cpp

# Documentation files processed by groff
*.1 text eol=lf
*.3 text eol=lf
*.5 text eol=lf
*.html text eol=lf
*.lsm text eol=lf
*.man text eol=lf
*.so text eol=lf

# Script files
*.awk text eol=lf
*.sh text eol=lf

# Image files
*.ico binary
*.png binary
17 changes: 17 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ jobs:
mingw-w64-${{ matrix.env }}-ninja
mingw-w64-${{ matrix.env }}-doxygen
mingw-w64-${{ matrix.env }}-graphviz
mingw-w64-${{ matrix.env }}-ghostscript
mingw-w64-${{ matrix.env }}-texlive-bin
diffutils
groff
- uses: actions/checkout@v3

Expand All @@ -57,3 +60,17 @@ jobs:
- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml

- name: Build all
working-directory: build
run: ninja

- name: Create ZIP package
working-directory: build
run: cpack -G ZIP

- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: msys2-${{ matrix.env }}-packages
path: build/srecord-*.*
27 changes: 19 additions & 8 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ add_custom_command(OUTPUT ${NEW_CHANGES}

# Transform man page(s) (ie troff format files) into a PDF
function(add_doc TARGET SOURCE DEPS)
add_custom_command(OUTPUT ${TARGET}
add_custom_command(OUTPUT ${TARGET}.groff.ps
COMMAND
sh ${CMAKE_CURRENT_SOURCE_DIR}/script/groff.sh
-T ps # Output device
Expand All @@ -182,22 +182,33 @@ function(add_doc TARGET SOURCE DEPS)
-I${DocSourcePath}
-I${DocBinaryPath}
${SOURCE} # Source
> ${TARGET}.ps.tmp
> ${TARGET}.groff.ps
DEPENDS
${SOURCE}
${DEPS}
${CMAKE_CURRENT_SOURCE_DIR}/script/groff.sh
COMMENT "Building ${TARGET}.groff.ps"
VERBATIM)

add_custom_command(OUTPUT ${TARGET}.ps
COMMAND
sh ${CMAKE_CURRENT_SOURCE_DIR}/script/page_select.sh
${CMAKE_CURRENT_SOURCE_DIR}/script/page-list.awk
${TARGET}.ps.tmp
${TARGET}.groff.ps
${TARGET}.ps
COMMAND ${PS2PDF} ${TARGET}.ps ${TARGET}
COMMAND rm ${TARGET}.ps ${TARGET}.ps.tmp
DEPENDS
${SOURCE}
${DEPS}
${CMAKE_CURRENT_SOURCE_DIR}/script/groff.sh
${TARGET}.groff.ps
${CMAKE_CURRENT_SOURCE_DIR}/script/page_select.sh
${CMAKE_CURRENT_SOURCE_DIR}/script/page-list.awk
COMMENT "Building ${TARGET}.ps"
VERBATIM)

add_custom_command(OUTPUT ${TARGET}
COMMAND ${PS2PDF} ${TARGET}.ps ${TARGET}
DEPENDS ${TARGET}.ps
COMMENT "Building ${TARGET}"
VERBATIM)

list(APPEND DOC_TARGETS ${TARGET})
set(DOC_TARGETS ${DOC_TARGETS} PARENT_SCOPE)
endfunction()
Expand Down

0 comments on commit cf963da

Please sign in to comment.