forked from sgkit-dev/sgkit-publication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
84 lines (73 loc) · 3.43 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# See https://www.appveyor.com/docs/getting-started-with-appveyor-for-linux/
# Don't build branches with a PR, since their build will be created with the PR itself.
# Otherwise there would be two builds -- one for the PR and one for the branch.
# If you're having issues with getting your PR to build, make sure there are no merge conflicts.
skip_branch_with_pr: true
# Enable 'Do not build on "Push" events' in the AppVeyor project settings
# to only build commits from pull requests
branches:
only:
- main
- master
# Only run AppVeyor on commits that modify at least one of the following files
# Delete these lines to run AppVeyor on all main/master branch commits
only_commits:
files:
- .appveyor.yml
- build/
- ci/install.sh
- content/
image: ubuntu
services:
- docker
# Set SPELLCHECK to true to enable Pandoc spellchecking
environment:
SPELLCHECK: true
install:
# Create the message with the triggering commit before install so it is
# available if the build fails
- TRIGGERING_COMMIT=${APPVEYOR_PULL_REQUEST_HEAD_COMMIT:-APPVEYOR_REPO_COMMIT}
- JOB_MESSAGE=" for commit $TRIGGERING_COMMIT "
- source ci/install.sh
test_script:
- bash build/build.sh
- MANUSCRIPT_FILENAME=manuscript-$APPVEYOR_BUILD_VERSION-${TRIGGERING_COMMIT:0:7}
- cp output/manuscript.html $MANUSCRIPT_FILENAME.html
- cp output/manuscript.pdf $MANUSCRIPT_FILENAME.pdf
- appveyor PushArtifact $MANUSCRIPT_FILENAME.html
- appveyor PushArtifact $MANUSCRIPT_FILENAME.pdf
- |
if [ "${SPELLCHECK:-}" = "true" ]; then
SPELLING_ERRORS_FILENAME=spelling-errors-$APPVEYOR_BUILD_VERSION-${TRIGGERING_COMMIT:0:7}.txt
cp output/spelling-errors.txt $SPELLING_ERRORS_FILENAME
appveyor PushArtifact $SPELLING_ERRORS_FILENAME
SPELLING_ERROR_LOCATIONS_FILENAME=spelling-error-locations-$APPVEYOR_BUILD_VERSION-${TRIGGERING_COMMIT:0:7}.txt
cp output/spelling-error-locations.txt $SPELLING_ERROR_LOCATIONS_FILENAME
appveyor PushArtifact $SPELLING_ERROR_LOCATIONS_FILENAME
fi
build: off
cache:
- ci/cache
on_success:
- echo "Artifacts available from $APPVEYOR_URL/project/$APPVEYOR_ACCOUNT_NAME/$APPVEYOR_PROJECT_SLUG/builds/$APPVEYOR_BUILD_ID/artifacts"
- echo "Updated PDF available from $APPVEYOR_URL/api/buildjobs/$APPVEYOR_JOB_ID/artifacts/$MANUSCRIPT_FILENAME.pdf"
- appveyor AddMessage "$JOB_MESSAGE is now complete."
- |
if [ "${SPELLCHECK:-}" = "true" ]; then
SPELLING_ERROR_COUNT=($(wc -l $SPELLING_ERROR_LOCATIONS_FILENAME))
appveyor AddMessage " <details><summary>Found $SPELLING_ERROR_COUNT potential spelling error(s). Preview:</summary>$(head -n 100 $SPELLING_ERROR_LOCATIONS_FILENAME)"
appveyor AddMessage "... </details>"
fi
on_failure:
- appveyor AddMessage "$JOB_MESSAGE failed."
# The following lines can be safely deleted, which will disable AppVeyorBot
# notifications in GitHub pull requests
# Notifications use Mustache templates http://mustache.github.io/mustache.5.html
# See https://www.appveyor.com/docs/notifications/#customizing-message-template
# for available variables
notifications:
- provider: GitHubPullRequest
template: "AppVeyor [build {{buildVersion}}]({{buildUrl}})
{{#jobs}}{{#messages}}{{{message}}}{{/messages}}{{/jobs}}
{{#passed}}The rendered manuscript from this build is temporarily available for download at:\n\n
{{#jobs}}{{#artifacts}}- [`{{fileName}}`]({{permalink}})\n{{/artifacts}}{{/jobs}}{{/passed}}"