version: 2 defaults: &defaults docker: - image: gallileo/radarr-cci-primary:5.8.9 environment: BUILD_VERSION: 0.2.0 jobs: build: <<: *defaults steps: - restore_cache: keys: - source-v1-{{ .Branch }}-{{ .Revision }} - source-v1-{{ .Branch }}- - source-v1- - checkout - run: git submodule update --init --recursive - save_cache: key: source-v1-{{ .Branch }}-{{ .Revision }} paths: - ".git" - run: name: Patching Assembly Info command: sed -i "s/AssemblyVersion(\".*\")/AssemblyVersion(\"$BUILD_VERSION.$CIRCLE_BUILD_NUM\")/gi" src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs && cat src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs - run: name: Clean Build command: ./build.sh Clean - run: name: Restore Nuget command: ./build.sh NugetMono - run: name: Build command: ./build.sh Build - restore_cache: keys: - v1-npm-deps-{{ checksum "package.json" }} # Find the most recent cache used from any branch - v1-npm-deps- - run: name: Gulp command: ./build.sh Gulp - save_cache: key: v1-npm-deps-{{ checksum "package.json" }} paths: - "node_modules" - run: name: Package command: ./build.sh Package - run: name: Preparing Tests command: mkdir -p _tests/reports/junit && mkdir -p ../.config/Radarr && chmod -R 777 ../.config - persist_to_workspace: root: . # Must be relative path from root paths: - _output - _output_mono - _output_osx - _output_osx_app - _tests - setup - .circleci - deploy.sh unit_tests: <<: *defaults steps: - attach_workspace: at: . - run: name: Preparing Tests command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config - run: name: Unit Tests command: ./_tests/test.sh Linux Unit - store_test_results: path: _tests/reports/ integration_tests: <<: *defaults steps: - attach_workspace: at: . - run: name: Copy Binaries for Integration Tests command: cp -R _output_mono/ _tests/bin - run: name: Preparing Tests command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config - run: name: Integration Tests command: ./_tests/test.sh Linux Integration - store_test_results: path: _tests/reports/ publish_artifacts: <<: *defaults steps: - attach_workspace: at: . - run: name: "Creating packages" command: | mkdir -p _packages/ cp -r _output/ _packages/Radarr zip -r _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.windows.zip _packages/Radarr rm -rf _packages/Radarr cp -r _output_mono/ _packages/Radarr tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.linux.tar.gz -C _packages Radarr rm -rf _packages/Radarr cp -r _output_osx/ _packages/Radarr tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx.tar.gz -C _packages Radarr rm -rf _packages/Radarr cd _output_osx_app/ zip -r ../_packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx-app.zip * - run: name: "Creating Installer" command: wine setup/inno/ISCC.exe setup/nzbdrone.iss && cp -r setup/Output/Radarr* _packages/ - store_artifacts: path: _packages destination: artifacts #- run: # name: "Deploying" # command: chmod +x deploy.sh && ./deploy.sh - persist_to_workspace: root: . # Must be relative path from root paths: - _packages deploy: <<: *defaults steps: - attach_workspace: at: . - restore_cache: keys: - source-v1-{{ .Branch }}-{{ .Revision }} - source-v1-{{ .Branch }}- - source-v1- - checkout - run: name: Creating Release command: export LC_ALL=C.UTF-8 && export changelog=$(GITCHANGELOG_CONFIG_FILENAME=.gitchangelog.rc.release gitchangelog) && echo "Deploying v$BUILD_VERSION.$CIRCLE_BUILD_NUM to Github, with changelog:\n\n$changelog" && github-release release -u Radarr -r Radarr -t "v$BUILD_VERSION" -p --draft -d "$changelog" -n "Pre-Release v$BUILD_VERSION" - run: name: Uploading Assets command: cd _packages && ls Radarr.*.* | xargs -n1 -P0 -I{} -- github-release upload -u Radarr -r Radarr -t "v$BUILD_VERSION.$CIRCLE_BUILD_NUM" --name {} --file {} workflows: version: 2 build_and_test: jobs: - build - unit_tests: requires: - build #- integration_tests: # requires: # - build - publish_artifacts: requires: - build #- request_deploy: # type: approval # requires: # - publish_artifacts #- deploy: # requires: # - request_deploy