|
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + cargo_fetch: |
| 4 | + docker: |
| 5 | + - image: broooooklyn/rust-python:latest |
| 6 | + working_directory: /mnt/crate |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - restore_cache: |
| 10 | + keys: |
| 11 | + - cargo-v1-{{ checksum "Cargo.toml" }}- |
| 12 | + - cargo-v1- |
| 13 | + - run: |
| 14 | + name: fetch and update |
| 15 | + command: | |
| 16 | + cargo update && \ |
| 17 | + cargo fetch |
| 18 | + - persist_to_workspace: |
| 19 | + root: "." |
| 20 | + paths: |
| 21 | + - Cargo.lock |
| 22 | + - save_cache: |
| 23 | + key: cargo-v1-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} |
| 24 | + paths: |
| 25 | + - /usr/local/cargo/registry |
| 26 | + - /usr/local/cargo/git |
| 27 | + build35: |
| 28 | + docker: |
| 29 | + - image: broooooklyn/rust-python:3.5 |
| 30 | + working_directory: /mnt/crate |
| 31 | + steps: |
| 32 | + - checkout |
| 33 | + - attach_workspace: |
| 34 | + at: "." |
| 35 | + - restore_cache: |
| 36 | + keys: |
| 37 | + - cargo-v1-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} |
| 38 | + - run: |
| 39 | + name: Print version information |
| 40 | + command: rustc --version; cargo --version |
| 41 | + - run: |
| 42 | + name: Build 35 |
| 43 | + command: | |
| 44 | + python compile.py build |
| 45 | + - run: |
| 46 | + name: Upload binary |
| 47 | + command: | |
| 48 | + ghr $CIRCLE_TAG build/lib/py_sourcemap/*.so |
| 49 | + - run: |
| 50 | + name: Prune the output files |
| 51 | + command: | |
| 52 | + for file in target/release/* target/release/.??*; do |
| 53 | + [ -d $file -o ! -x $file ] && rm -r $file |
| 54 | + done |
| 55 | + - persist_to_workspace: |
| 56 | + root: "." |
| 57 | + paths: |
| 58 | + - target/release/* |
| 59 | + build36: |
| 60 | + docker: |
| 61 | + - image: broooooklyn/rust-python:3.6 |
| 62 | + working_directory: /mnt/crate |
| 63 | + steps: |
| 64 | + - checkout |
| 65 | + - attach_workspace: |
| 66 | + at: "." |
| 67 | + - restore_cache: |
| 68 | + keys: |
| 69 | + - cargo-v1-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} |
| 70 | + - run: |
| 71 | + name: Print version information |
| 72 | + command: rustc --version; cargo --version |
| 73 | + - run: |
| 74 | + name: Build 36 |
| 75 | + command: | |
| 76 | + python compile.py build |
| 77 | + - run: |
| 78 | + name: Upload binary |
| 79 | + command: | |
| 80 | + ghr $CIRCLE_TAG build/lib/py_sourcemap/*.so |
| 81 | + - run: |
| 82 | + name: Prune the output files |
| 83 | + command: | |
| 84 | + for file in target/release/* target/release/.??*; do |
| 85 | + [ -d $file -o ! -x $file ] && rm -r $file |
| 86 | + done |
| 87 | + - persist_to_workspace: |
| 88 | + root: "." |
| 89 | + paths: |
| 90 | + - target/release/* |
| 91 | + build37: |
| 92 | + docker: |
| 93 | + - image: broooooklyn/rust-python:3.7 |
| 94 | + working_directory: /mnt/crate |
| 95 | + steps: |
| 96 | + - checkout |
| 97 | + - attach_workspace: |
| 98 | + at: "." |
| 99 | + - restore_cache: |
| 100 | + keys: |
| 101 | + - cargo-v1-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }} |
| 102 | + - run: |
| 103 | + name: Print version information |
| 104 | + command: rustc --version; cargo --version |
| 105 | + - run: |
| 106 | + name: Build 37 |
| 107 | + command: | |
| 108 | + python compile.py build |
| 109 | + - run: |
| 110 | + name: Upload binary |
| 111 | + command: | |
| 112 | + ghr $CIRCLE_TAG build/lib/py_sourcemap/*.so |
| 113 | + - run: |
| 114 | + name: Prune the output files |
| 115 | + command: | |
| 116 | + for file in target/release/* target/release/.??*; do |
| 117 | + [ -d $file -o ! -x $file ] && rm -r $file |
| 118 | + done |
| 119 | + - persist_to_workspace: |
| 120 | + root: "." |
| 121 | + paths: |
| 122 | + - target/release/* |
| 123 | + |
| 124 | + nightly: |
| 125 | + machine: true |
| 126 | + triggers: |
| 127 | + - schedule: |
| 128 | + cron: "0 0 * * *" |
| 129 | + filters: |
| 130 | + branches: |
| 131 | + only: |
| 132 | + - master |
| 133 | + steps: |
| 134 | + - checkout |
| 135 | + - run: docker login -u $DOCKER_USER -p $DOCKER_PASS |
| 136 | + - run: docker build . -t broooooklyn/rust-python:3.5 --build-arg PYTHON_VERSION=3.5 |
| 137 | + - run: docker push broooooklyn/rust-python:3.5 |
| 138 | + - run: docker build . -t broooooklyn/rust-python:3.6 --build-arg PYTHON_VERSION=3.6 |
| 139 | + - run: docker push broooooklyn/rust-python:3.6 |
| 140 | + - run: docker build . -t broooooklyn/rust-python:3.7 --build-arg PYTHON_VERSION=3.7 |
| 141 | + - run: docker tag broooooklyn/rust-python:3.7 broooooklyn/rust-python:latest |
| 142 | + - run: docker push broooooklyn/rust-python:3.7 |
| 143 | + - run: docker push broooooklyn/rust-python:latest |
| 144 | +workflows: |
| 145 | + version: 2 |
| 146 | + build_all_versions: |
| 147 | + jobs: |
| 148 | + - cargo_fetch |
| 149 | + - build35: |
| 150 | + requires: |
| 151 | + - cargo_fetch |
| 152 | + - build36: |
| 153 | + requires: |
| 154 | + - cargo_fetch |
| 155 | + - build37: |
| 156 | + requires: |
| 157 | + - cargo_fetch |
0 commit comments