version: 2.1 executors: cider-ci: docker: - image: electronuserland/builder:wine working_directory: ~/Cider orbs: # Add orbs to your configuration jira: circleci/jira@1.0.5 # invokes the Jira orb, making its commands accessible # The jobs for this project jobs: prepare-build: executor: cider-ci steps: - checkout - run: name: Fetch Application Version command: ./resources/version.sh || true - restore_cache: key: dependency-cache-{{ checksum "pnpm-lock.yaml" }} - run: name: Clear node_airtunes2 cache command: rm -rf ~/.pnpm-store/tmp/cf5bc2de2629636ca224995234b8eaa1 || true - run: name: Install Node Dependencies command: pnpm install --frozen-lockfile - run: name: TypeScript Compile command: pnpm run build - save_cache: key: dependency-cache-{{ checksum "pnpm-lock.yaml" }} paths: - node_modules - ~/.pnpm-store - persist_to_workspace: # Must be an absolute path, or relative path from working_directory. This is a directory on the container which is # taken to be the root directory of the workspace. root: . # Must be relative path from root paths: - src - node_modules - build - resources - package.json - winget.json # winget.json is a file that is generated by the winget package manager - LICENSE build-linux: executor: cider-ci steps: - attach_workspace: at: ~/Cider - run: name: Generate Builds (Linux) command: yarn electron-builder -l -p never post-steps: - jira/notify - persist_to_workspace: root: . paths: - dist/*.deb - dist/*.AppImage - dist/*.snap - dist/latest-linux.yml build-windows: executor: cider-ci steps: - attach_workspace: at: ~/Cider - run: name: Generate Builds (Windows) command: yarn electron-builder -w --x64 -p never post-steps: - jira/notify - persist_to_workspace: root: . paths: - dist/*.exe - dist/Cider-Setup-*.exe.blockmap - dist/latest.yml build-winget: executor: cider-ci steps: - attach_workspace: at: ~/Cider - run: name: Generate Builds (Winget) command: yarn electron-builder --win -c winget.json -p never post-steps: - jira/notify - persist_to_workspace: root: . paths: - dist/*.exe - dist/Cider-Setup-winget-*.exe.blockmap release: docker: - image: cimg/node:lts-browsers working_directory: ~/Cider steps: - attach_workspace: at: ~/Cider/ - run: name: Installing GitHub Command Line Interface command: | sudo apt-get update -y curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt-get update -y sudo apt install -y gh - run: name: Move Build Files command: | mkdir ~/Cider/dist/artifacts/ mv ~/Cider/dist/*.exe ~/Cider/dist/artifacts mv ~/Cider/dist/*.deb ~/Cider/dist/artifacts mv ~/Cider/dist/*.AppImage ~/Cider/dist/artifacts mv ~/Cider/dist/*.snap ~/Cider/dist/artifacts mv ~/Cider/dist/*.yml ~/Cider/dist/artifacts mv ~/Cider/dist/*.blockmap ~/Cider/dist/artifacts - store_artifacts: path: ~/Cider/dist/artifacts - run: name: Run Version Script command: | sudo chmod +x resources/version.sh && ./resources/version.sh || true echo "export APP_VERSION=$(node -p -e 'require("./package.json").version')" >>$BASH_ENV - run: name: Publish Release command: | echo "Attempting to create release for Cider v${APP_VERSION} on the ${CIRCLE_BRANCH} branch." gh release create "v${APP_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes "**Beta Release** A full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main). These builds are considered bleeding edge, expect bugs and please do not use this as a representation of the full app. Our full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-nightly-beta-releases)." -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap # Orchestrate our job run sequence workflows: build_and_release: jobs: - prepare-build: filters: branches: only: - main - stable - build-windows: requires: - prepare-build filters: branches: only: - main - stable - build-linux: requires: - prepare-build filters: branches: only: - main - stable - build-winget: requires: - prepare-build filters: branches: only: - main - stable - release: requires: - build-windows - build-linux - build-winget filters: branches: only: - main - stable