|
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + build_linux: |
| 4 | + docker: |
| 5 | + - image: rflathers/centos5_python27 |
| 6 | + working_directory: ~/impacket |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - run: |
| 10 | + name: install impacket |
| 11 | + command: | |
| 12 | + pip install . |
| 13 | + - run: |
| 14 | + name: install pyinstaller |
| 15 | + command: | |
| 16 | + pip install pip==18.1 |
| 17 | + pip install setuptools==40.6.3 |
| 18 | + pip install pyinstaller==3.4 |
| 19 | + - run: |
| 20 | + name: gross hacky hack |
| 21 | + command: | |
| 22 | + sed -r -i 's/sys\.std(in|out)\.encoding/"UTF-8"/g' examples/*exec.py |
| 23 | + - run: |
| 24 | + name: Create standalone executables |
| 25 | + command: | |
| 26 | + for i in examples/*.py; do pyinstaller -F $i; done |
| 27 | + - run: |
| 28 | + name: Rename binaries |
| 29 | + command: | |
| 30 | + ARCH=$(uname -m) |
| 31 | + find dist/ -type f -exec mv {} {}_linux_$ARCH \; |
| 32 | + - run: |
| 33 | + name: Tarball binaries |
| 34 | + command: | |
| 35 | + tar czf impacket_linux_binaries.tar.gz -C dist/ . |
| 36 | + mv impacket_linux_binaries.tar.gz dist/ |
| 37 | + - run: |
| 38 | + name: Write version.txt |
| 39 | + command: | |
| 40 | + awk -F '"' '/version =/{print $2} ' setup.py > ./dist/version.txt |
| 41 | + - store_artifacts: |
| 42 | + path: ./dist |
| 43 | + - persist_to_workspace: |
| 44 | + root: dist |
| 45 | + paths: |
| 46 | + - ./* |
| 47 | + build_windows: |
| 48 | + docker: |
| 49 | + - image: cdrx/pyinstaller-windows:python2 |
| 50 | + working_directory: ~/impacket |
| 51 | + steps: |
| 52 | + - checkout |
| 53 | + - run: |
| 54 | + name: install impacket |
| 55 | + command: | |
| 56 | + pip install . |
| 57 | + - run: |
| 58 | + name: create standalone executables |
| 59 | + command: | |
| 60 | + for i in examples/*.py; do pyinstaller -F $i; done |
| 61 | + - run: |
| 62 | + name: rename binaries |
| 63 | + command: | |
| 64 | + for f in dist/*.exe; do mv "$f" "${f%.*}_windows.${f##*.}"; done |
| 65 | + - run: |
| 66 | + name: zip binaries |
| 67 | + command: | |
| 68 | + zip -r impacket_windows_binaries.zip dist/ |
| 69 | + mv impacket_windows_binaries.zip dist/ |
| 70 | + - store_artifacts: |
| 71 | + path: ./dist |
| 72 | + - persist_to_workspace: |
| 73 | + root: dist |
| 74 | + paths: |
| 75 | + - ./* |
| 76 | + build_alpine: |
| 77 | + docker: |
| 78 | + - image: rflathers/alpine34_pyinstaller:latest |
| 79 | + working_directory: ~/impacket |
| 80 | + steps: |
| 81 | + - checkout |
| 82 | + - run: |
| 83 | + name: install impacket |
| 84 | + command: | |
| 85 | + pip install . |
| 86 | + - run: |
| 87 | + name: gross hacky hack |
| 88 | + command: | |
| 89 | + sed -r -i 's/sys\.std(in|out)\.encoding/"UTF-8"/g' examples/*exec.py |
| 90 | + - run: |
| 91 | + name: create standalone executables |
| 92 | + command: | |
| 93 | + for i in examples/*.py; do pyinstaller -F $i; done |
| 94 | + - run: |
| 95 | + name: Rename binaries |
| 96 | + command: | |
| 97 | + ARCH=$(uname -m) |
| 98 | + find dist/ -type f -exec mv {} {}_musl_$ARCH \; |
| 99 | + - run: |
| 100 | + name: tarball binaries |
| 101 | + command: | |
| 102 | + tar czf impacket_musl_binaries.tar.gz -C dist/ . |
| 103 | + - store_artifacts: |
| 104 | + path: ./dist |
| 105 | + - persist_to_workspace: |
| 106 | + root: . |
| 107 | + paths: |
| 108 | + - impacket_musl_binaries.tar.gz |
| 109 | + github-release: |
| 110 | + docker: |
| 111 | + - image: cibuilds/github:0.10 |
| 112 | + steps: |
| 113 | + - attach_workspace: |
| 114 | + at: ./artifacts |
| 115 | + - run: |
| 116 | + name: "Publish Binaries on Github" |
| 117 | + command: | |
| 118 | + VERSION=$(cat ./artifacts/version.txt) |
| 119 | + ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION}-binaries ./artifacts/ |
| 120 | +
|
| 121 | +workflows: |
| 122 | + version: 2 |
| 123 | + main: |
| 124 | + jobs: |
| 125 | + - build_linux: |
| 126 | + filters: |
| 127 | + branches: |
| 128 | + only: |
| 129 | + - master |
| 130 | + - /release-.*/ |
| 131 | + - build_windows: |
| 132 | + filters: |
| 133 | + branches: |
| 134 | + only: |
| 135 | + - master |
| 136 | + - /release-.*/ |
| 137 | + - build_alpine: |
| 138 | + filters: |
| 139 | + branches: |
| 140 | + only: |
| 141 | + - master |
| 142 | + - /release-.*/ |
| 143 | + - github-release: |
| 144 | + filters: |
| 145 | + branches: |
| 146 | + only: |
| 147 | + - master |
| 148 | + - /release-.*/ |
| 149 | + context: "Github Token" |
| 150 | + requires: |
| 151 | + - build_linux |
| 152 | + - build_windows |
| 153 | + - build_alpine |
0 commit comments