200 lines
5.5 KiB
YAML
200 lines
5.5 KiB
YAML
version: 2.1
|
|
|
|
orbs:
|
|
docker: circleci/docker@0.5.20
|
|
|
|
jobs:
|
|
build-rookeries:
|
|
docker:
|
|
- image: dorianpula/rookeries-build:latest
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Build Rookeries
|
|
command: cargo make build-all
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- rookeries-plugins.zip
|
|
- rookeries-template.zip
|
|
|
|
test-site-generator:
|
|
docker:
|
|
- image: dorianpula/rookeries-build:latest
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Audit dependencies.
|
|
command: cargo audit
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Run a site initialization once to install Rookeries plugins and templates
|
|
command: |
|
|
INITIAL_RUN=$(mktemp -d)
|
|
cargo run -- init ${INITIAL_RUN}
|
|
- run:
|
|
name: Test static site generator
|
|
command: cargo make test
|
|
- run:
|
|
name: Check code with clippy
|
|
command: cargo clippy
|
|
|
|
test-site-app:
|
|
docker:
|
|
- image: dorianpula/rookeries-build:latest
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Build site webapp
|
|
command: |
|
|
cargo make install-js
|
|
cargo make build-js
|
|
- run:
|
|
name: Test site webapp
|
|
command: cargo make test-js
|
|
|
|
test-plugins:
|
|
docker:
|
|
- image: dorianpula/rookeries-build:latest
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Test plugins
|
|
command: cargo make test-plugins
|
|
|
|
# TODO: Add ability to upload releases to api.rookeries.org/
|
|
publish-linux:
|
|
docker:
|
|
- image: dorianpula/rookeries-build:latest
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Build Linux release.
|
|
command: |
|
|
cargo build --release
|
|
cp target/release/rookeries rookeries-linux-latest.bin
|
|
shasum -a 512 rookeries-linux-latest.bin >> rookeries-linux-latest.bin.shasum512
|
|
- store_artifacts:
|
|
path: rookeries-linux-latest.bin
|
|
- store_artifacts:
|
|
path: rookeries-linux-latest.bin.shasum512
|
|
|
|
publish-macos:
|
|
macos:
|
|
xcode: "11.3.1"
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dev dependencies
|
|
# macOS VMs come with homebrew and node installed.
|
|
command: |
|
|
brew install rust
|
|
cargo install cargo-make
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Build macOS release.
|
|
command: |
|
|
cargo build --release
|
|
cp target/release/rookeries rookeries-darwin-latest.bin
|
|
shasum -a 512 rookeries-darwin-latest.bin >> rookeries-darwin-latest.bin.shasum512
|
|
- store_artifacts:
|
|
path: rookeries-darwin-latest.bin
|
|
- store_artifacts:
|
|
path: rookeries-darwin-latest.bin.shasum512
|
|
|
|
publish-freebsd:
|
|
docker:
|
|
- image: "dorianpula/rookeries-build:freebsd-latest"
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: Build FreeBSD release.
|
|
command: |
|
|
cargo build --target x86_64-unknown-freebsd --release
|
|
cp target/x86_64-unknown-freebsd/release/rookeries rookeries-freebsd-latest.bin
|
|
shasum -a 512 rookeries-freebsd-latest.bin >> rookeries-freebsd-latest.bin.shasum512
|
|
- store_artifacts:
|
|
path: rookeries-freebsd-latest.bin
|
|
- store_artifacts:
|
|
path: rookeries-freebsd-latest.bin.shasum512
|
|
|
|
workflows:
|
|
version: 2
|
|
scheduled-docker-build:
|
|
# TODO: Change CI over to dorianpula/rookeries:freebsd-build-latest and build-latest after successful builds.
|
|
jobs:
|
|
- docker/publish:
|
|
name: docker-linux-build-image
|
|
image: dorianpula/rookeries-build
|
|
docker-username: DOCKER_USER
|
|
docker-password: DOCKER_PASS
|
|
tag: latest
|
|
cache_from: "dorianpula/rookeries:build-latest"
|
|
extra_build_args: "--target BUILD"
|
|
|
|
- docker/publish:
|
|
name: docker-freebsd-build-image
|
|
image: dorianpula/rookeries-build
|
|
docker-username: DOCKER_USER
|
|
docker-password: DOCKER_PASS
|
|
tag: freebsd-latest
|
|
path: freebsd-builder
|
|
cache_from: "dorianpula/rookeries:freebsd-build-latest"
|
|
|
|
triggers:
|
|
- schedule:
|
|
cron: "0 15 * * 6"
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
|
|
build-test-publish:
|
|
jobs:
|
|
- build-rookeries
|
|
|
|
- test-site-generator:
|
|
requires:
|
|
- build-rookeries
|
|
- test-site-app:
|
|
requires:
|
|
- build-rookeries
|
|
- test-plugins:
|
|
requires:
|
|
- build-rookeries
|
|
|
|
- publish-linux:
|
|
requires:
|
|
- test-site-generator
|
|
- test-site-app
|
|
- test-plugins
|
|
- publish-macos:
|
|
requires:
|
|
- test-site-generator
|
|
- test-site-app
|
|
- test-plugins
|
|
- publish-freebsd:
|
|
requires:
|
|
- test-site-generator
|
|
- test-site-app
|
|
- test-plugins
|
|
- docker/publish:
|
|
name: publish-docker
|
|
cache_from: "dorianpula/rookeries:latest,dorianpula/rookeries-build:latest"
|
|
image: dorianpula/rookeries
|
|
docker-username: DOCKER_USER
|
|
docker-password: DOCKER_PASS
|
|
tag: latest
|
|
requires:
|
|
- test-site-generator
|
|
- test-site-app
|
|
- test-plugins
|