-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
6,476 additions
and
14,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,231 @@ | ||
version: 2 | ||
version: 2.1 | ||
|
||
jobs: | ||
|
||
# build-macos: | ||
# macos: | ||
# xcode: "9.0" | ||
# environment: | ||
# FL_OUTPUT_DIR: output | ||
# steps: | ||
# - checkout | ||
# - run: | ||
# name: Setup Certificates | ||
# command: | | ||
# security create-keychain -p $keychain default.keychain | ||
# echo $certificate | base64 -D > /tmp/default.p12 | ||
# security import /tmp/default.p12 -t agg -k default.keychain -P '' -A | ||
# - run: | ||
# name: Setup NVM | ||
# command: | | ||
# export NODE_VERSION=$(cat .nvmrc) | ||
# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash -s -- --no-use | ||
# echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV | ||
# echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV | ||
# echo 'nvm install v11.12.0' >> $BASH_ENV | ||
# echo 'nvm alias default v11.12.0' >> $BASH_ENV | ||
# - run: | ||
# command: yarn --frozen-lockfile | ||
# - run: | ||
# command: CSC_LINK=file:///tmp/default.p12 yarn run package:mac | ||
# - run: | ||
# command: mv dist dist-mac | ||
# - persist_to_workspace: | ||
# root: . | ||
# paths: | ||
# - dist-mac | ||
|
||
# build-linux: | ||
# docker: | ||
# - image: circleci/node:11.12.0 | ||
# environment: | ||
# BASH_ENV: ".circleci/bashrc" | ||
# steps: | ||
# - checkout | ||
# - run: | ||
# command: yarn --frozen-lockfile | ||
# - run: | ||
# command: yarn run package:linux | ||
# - run: | ||
# command: mv dist dist-linux | ||
# - persist_to_workspace: | ||
# root: . | ||
# paths: | ||
# - dist-linux | ||
|
||
deploy: | ||
build-macos: | ||
macos: | ||
xcode: "9.0" | ||
environment: | ||
FL_OUTPUT_DIR: output | ||
steps: | ||
- checkout | ||
- run: | ||
name: Setup Certificates | ||
command: | | ||
security create-keychain -p $keychain default.keychain | ||
echo $certificate | base64 -D > /tmp/default.p12 | ||
security import /tmp/default.p12 -t agg -k default.keychain -P '' -A | ||
- run: | ||
name: Setup NVM | ||
command: | | ||
export NODE_VERSION=$(cat .nvmrc) | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash -s -- --no-use | ||
echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV | ||
echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV | ||
echo 'nvm install v11.12.0' >> $BASH_ENV | ||
echo 'nvm alias default v11.12.0' >> $BASH_ENV | ||
- run: | ||
command: yarn && yarn run link | ||
- run: | ||
command: | | ||
export NODE_ENV=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "production" || echo "development") | ||
CSC_LINK=file:///tmp/default.p12 yarn run package:mac | ||
- run: | ||
command: mv dist dist-macos | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- dist-macos | ||
|
||
build-linux: | ||
docker: | ||
- image: circleci/node:11.12.0 | ||
environment: | ||
BASH_ENV: ".circleci/bashrc" | ||
steps: | ||
- checkout | ||
# - attach_workspace: | ||
# at: /tmp/workspace | ||
- run: | ||
command: yarn --frozen-lockfile | ||
command: yarn && yarn run link | ||
- run: | ||
command: | | ||
TARGET=electron yarn run build | ||
mv ./app/dist /tmp/build-electron | ||
# - run: | ||
# command: | | ||
# TARGET=web yarn run build | ||
# mv ./app/dist /tmp/build-web | ||
export NODE_ENV=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "production" || echo "development") | ||
yarn run package:linux | ||
- run: | ||
command: mv dist dist-linux | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- dist-linux | ||
|
||
build-web: | ||
docker: | ||
- image: circleci/node:11.12.0 | ||
environment: | ||
BASH_ENV: ".circleci/bashrc" | ||
steps: | ||
- checkout | ||
- run: | ||
command: yarn && yarn run link | ||
- run: | ||
command: | | ||
export NODE_ENV=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "production" || echo "development") | ||
TARGET=electron yarn run build:renderer | ||
mv ./app/dist dist-web-electron | ||
- run: | ||
command: | | ||
export NODE_ENV=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "production" || echo "development") | ||
TARGET=browser yarn run build:renderer | ||
mv ./app/dist dist-web-browser | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- dist-web-electron | ||
- dist-web-browser | ||
|
||
deploy-releases: | ||
docker: | ||
- image: circleci/node:11.12.0 | ||
environment: | ||
BASH_ENV: ".circleci/bashrc" | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Install deployment dependencies | ||
command: | | ||
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2 -O /home/circleci/linux-amd64-github-release.tar.bz2 | ||
tar xjf /home/circleci/linux-amd64-github-release.tar.bz2 -C /home/circleci | ||
sudo mv /home/circleci/bin/linux/amd64/github-release /usr/local/bin | ||
rm -Rf /home/circleci/bin/linux | ||
chmod a+x /usr/local/bin/github-release | ||
- run: | ||
name: Deploy releases | ||
command: | | ||
VERSION=v`jq -r '.version' package.json` | ||
VERSION_TAG=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "${VERSION}" || echo "${VERSION}-rc") | ||
TAG=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "latest" || echo "nightly") | ||
RELEASE_OPTS="" | ||
if [ "${CIRCLE_BRANCH}" != "master" ]; then | ||
if git tag -l | grep -q "^${VERSION}$" | ||
then | ||
echo "Warning: Found production tag. Please update the version on package.json." | ||
exit 1 | ||
fi | ||
git tag --delete "${VERSION_TAG}" || true | ||
git push --delete origin "${VERSION_TAG}" || true | ||
github-release delete -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" || true | ||
RELEASE_OPTS="--pre-release" | ||
fi | ||
git tag --delete "${TAG}" || true | ||
git push --delete origin "${TAG}" || true | ||
github-release delete -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" || true | ||
cd /tmp/workspace/dist-web-browser | ||
zip -r /tmp/c-pac_gui-${VERSION_TAG}-browser.zip . | ||
cd - | ||
git tag "${VERSION_TAG}" | ||
git tag "${TAG}" | ||
git push --tags | ||
github-release release -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "${VERSION_TAG}" ${RELEASE_OPTS} | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-linux-amd64.deb" --file /tmp/workspace/dist-linux/c-pac_gui_*_amd64.deb | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-linux-amd64.snap" --file /tmp/workspace/dist-linux/c-pac_gui_*_amd64.snap | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-linux-amd64.tar.gz" --file /tmp/workspace/dist-linux/c-pac_gui-*.tar.gz | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-osx-amd64.dmg" --file /tmp/workspace/dist-macos/C-PAC-*.dmg | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-osx-amd64.zip" --file /tmp/workspace/dist-macos/C-PAC-*-mac.zip | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${VERSION_TAG}" --name "c-pac_gui-${VERSION_TAG}-browser.zip" --file /tmp/c-pac_gui-*-browser.zip | ||
github-release release -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "${TAG}" ${RELEASE_OPTS} | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-linux-amd64.deb" --file /tmp/workspace/dist-linux/c-pac_gui_*_amd64.deb | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-linux-amd64.snap" --file /tmp/workspace/dist-linux/c-pac_gui_*_amd64.snap | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-linux-amd64.tar.gz" --file /tmp/workspace/dist-linux/c-pac_gui-*.tar.gz | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-osx-amd64.dmg" --file /tmp/workspace/dist-macos/C-PAC-*.dmg | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-osx-amd64.zip" --file /tmp/workspace/dist-macos/C-PAC-*-mac.zip | ||
github-release upload -u FCP-INDI -r C-PAC_GUI --tag "${TAG}" --name "c-pac_gui-${TAG}-browser.zip" --file /tmp/c-pac_gui-*-browser.zip | ||
deploy-web: | ||
docker: | ||
- image: circleci/node:11.12.0 | ||
environment: | ||
BASH_ENV: ".circleci/bashrc" | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/workspace | ||
- run: | ||
name: Configure git user | ||
command: | | ||
git config --global user.email "ci-build@fcp-indi.github.com" | ||
git config --global user.name "ci-build" | ||
- run: | ||
name: Build and deploy | ||
name: Deploy web-version | ||
command: | | ||
VERSION=`jq -r '.version' package.json` | ||
VERSION=v`jq -r '.version' package.json` | ||
VERSION_TAG=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "${VERSION}" || echo "${VERSION}-rc") | ||
TAG=$([ "${CIRCLE_BRANCH}" == "master" ] && echo "latest" || echo "nightly") | ||
git clone --single-branch --branch gh-pages git@github.com:FCP-INDI/C-PAC_GUI.git /tmp/repo | ||
cd /tmp/repo | ||
rm -Rf /tmp/repo/versions/$VERSION 2> /dev/null | true | ||
mkdir -p /tmp/repo/versions/$VERSION | ||
# mv /tmp/build-web /tmp/repo/versions/$VERSION/web | ||
mv /tmp/build-electron /tmp/repo/versions/$VERSION/electron | ||
rm -Rf /tmp/repo/versions/${VERSION_TAG} 2> /dev/null | true | ||
mkdir -p /tmp/repo/versions/${VERSION_TAG} | ||
cp -Rf /tmp/workspace/dist-web-browser /tmp/repo/versions/${VERSION_TAG}/browser | ||
cp -Rf /tmp/workspace/dist-web-electron /tmp/repo/versions/${VERSION_TAG}/electron | ||
if [ "${CIRCLE_BRANCH}" == "master" ]; then | ||
find . -maxdepth 1 ! -name '.git' ! -name 'versions' ! -name 'versions.txt' ! -name '.' -delete | ||
cp -Rf /tmp/workspace/dist-web-browser/* /tmp/repo | ||
fi | ||
rm -Rf /tmp/repo/versions/${TAG} 2> /dev/null | true | ||
mkdir -p /tmp/repo/versions/${TAG} | ||
cp -Rf /tmp/workspace/dist-web-browser /tmp/repo/versions/${TAG}/browser | ||
cp -Rf /tmp/workspace/dist-web-electron /tmp/repo/versions/${TAG}/electron | ||
ls -1 /tmp/repo/versions > /tmp/repo/versions.txt | ||
cd /tmp/repo | ||
git add . | ||
git commit -m "updates" | ||
git push -f origin gh-pages | ||
git commit -m "updates" || true | ||
git push -f origin gh-pages || true | ||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
|
||
# - build-linux | ||
# - build-macos: | ||
# context: c-pac_gui | ||
# - deploy: | ||
- deploy | ||
# requires: | ||
# - build-linux | ||
# - build-macos | ||
- build-linux: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
- build-macos: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
context: c-pac_gui | ||
- build-web: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
- deploy-releases: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- develop | ||
requires: | ||
- build-linux | ||
- build-macos | ||
- build-web | ||
- deploy-web: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- develop | ||
requires: | ||
- build-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ dist | |
|
||
.idea | ||
npm-debug.log.* | ||
node_modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.