Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
agitter committed Jun 5, 2020
2 parents 9522ea5 + b746270 commit 4c54c72
Show file tree
Hide file tree
Showing 33 changed files with 764 additions and 568 deletions.
83 changes: 83 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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:
- master

# Only run AppVeyor on commits that modify at least one of the following files
# Delete these lines to run AppVeyor on all 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}}"
64 changes: 64 additions & 0 deletions .github/workflows/manubot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Manubot
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
manubot:
name: Manubot
runs-on: ubuntu-latest
env:
GITHUB_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
SPELLCHECK: true
steps:
- name: Set Environment Variables
run: |
TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA}
TRIGGERING_SHA_7=${TRIGGERING_SHA::7}
echo "::set-env name=TRIGGERING_SHA_7::$TRIGGERING_SHA_7"
echo "TRIGGERING_SHA: $TRIGGERING_SHA"
- name: Checkout Repository
uses: actions/checkout@v2
with:
# fetch entire commit history to support get_rootstock_commit
fetch-depth: 0
- name: Cache
uses: actions/cache@v1
with:
path: ci/cache
key: ci-cache-${{ github.ref }}
restore-keys: |
ci-cache-refs/heads/master
- name: Install Environment
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: manubot
environment-file: build/environment.yml
auto-activate-base: false
miniconda-version: 'latest'
- name: Install Spellcheck
shell: bash --login {0}
run: |
if [ "${SPELLCHECK:-}" = "true" ]; then
bash ci/install-spellcheck.sh
fi
- name: Build Manuscript
shell: bash --login {0}
run: bash build/build.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: manuscript-${{ github.run_id }}-${{ env.TRIGGERING_SHA_7 }}
path: output
- name: Deploy Manuscript
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.repository.fork
env:
MANUBOT_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MANUBOT_SSH_PRIVATE_KEY: ${{ secrets.MANUBOT_SSH_PRIVATE_KEY }}
CI_BUILD_WEB_URL: https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks
CI_JOB_WEB_URL: https://github.com/${{ github.repository }}/runs/${{ github.run_id }}
shell: bash --login {0}
run: bash ci/deploy.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ webpage/v
# Manubot cache directory
ci/cache

# Pandoc filters downloaded during continuous integration setup
build/pandoc/filters/spellcheck.lua

# Python
__pycache__/
*.pyc
Expand Down
19 changes: 5 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,19 @@ services:
branches:
only:
- master
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh
--output-document miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- source $HOME/miniconda/etc/profile.d/conda.sh
- hash -r
- conda config
--set always_yes yes
--set changeps1 no
env:
- SPELLCHECK=true
install:
- conda env create --quiet --file build/environment.yml
- conda list --name manubot
- conda activate manubot
- source ci/install.sh
script:
- bash build/build.sh
cache:
directories:
- ci/cache
deploy:
provider: script
script: bash -o xtrace ci/deploy.sh
script: bash ci/deploy.sh
skip_cleanup: true
on:
branch: master
condition: $TRAVIS_EVENT_TYPE = "push"
condition: $TRAVIS_EVENT_TYPE = "push" && (-v MANUBOT_SSH_PRIVATE_KEY || "${!encrypted_*}" != "")
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ The directories are as follows:
+ [`webpage`](webpage) is a directory meant to be rendered as a static webpage for viewing the HTML manuscript.
+ [`build`](build) contains commands and tools for building the manuscript.
+ [`ci`](ci) contains files necessary for deployment via continuous integration.
For the CI configuration, see [`.travis.yml`](.travis.yml).

### Local execution

Expand All @@ -88,7 +87,7 @@ bash build/build.sh
# This is required to view local images in the HTML output.

# Configure the webpage directory
python build/webpage.py
manubot webpage

# You can now open the manuscript webpage/index.html in a web browser.
# Alternatively, open a local webserver at http://localhost:8000/ with the
Expand All @@ -98,7 +97,7 @@ python -m http.server
```

Sometimes it's helpful to monitor the content directory and automatically rebuild the manuscript when a change is detected.
The following command, while running, will trigger both the `build.sh` and `webpage.py` scripts upon content changes:
The following command, while running, will trigger both the `build.sh` script and `manubot webpage` command upon content changes:

```sh
bash build/autobuild.sh
Expand Down
Loading

0 comments on commit 4c54c72

Please sign in to comment.