From a79b24cd1d07e07a664ad7e300fc4cc654b3d95c Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 6 Sep 2019 09:13:34 +0900 Subject: [PATCH 1/3] Update CircleCI configuration to use v2.1 --- .circleci/config.yml | 127 ++++++++++++++++++++++++++----------------- 1 file changed, 76 insertions(+), 51 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 729eaa4d..91c9137f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,40 +1,66 @@ -references: - base: &base +version: 2.1 + +executors: + node: + parameters: + version: + type: string + default: lts docker: - - image: circleci/node:10.16.0 + - image: circleci/node:<< parameters.version >> working_directory: ~/marp-core - steps: - - run: node --version +commands: + install: + parameters: + postinstall: + type: steps + default: [] + yarn: + type: string + default: 1.17.3 + steps: # https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#upgradingdowngrading-yarn - run: - name: Upgrade and configure yarn + name: Upgrade yarn command: | sudo -E sh -c 'curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ - && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ - && ln -snf /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ - && ln -snf /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ - && rm yarn-v$YARN_VERSION.tar.gz' + && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \ + && ln -snf /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \ + && ln -snf /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \ + && rm yarn-v$YARN_VERSION.tar.gz' environment: - YARN_VERSION: 1.16.0 - - - checkout + YARN_VERSION: << parameters.yarn >> - restore_cache: keys: - - v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} - - v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}- - - v1-dependencies-{{ .Environment.CIRCLE_JOB }}- + - v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} + - v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}- + - v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}- - run: yarn install - - run: yarn audit + - steps: << parameters.postinstall >> - save_cache: - key: v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} + key: v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }} paths: - node_modules - ~/.cache/yarn + audit: + steps: + - checkout + - install: + postinstall: + - run: yarn audit + + test: + steps: + - run: node --version + + - checkout + - install + - run: name: Prettier formatting command: yarn check:format @@ -47,10 +73,6 @@ references: name: TSLint command: yarn lint:ts - - run: - name: TypeScript type checking - command: yarn check:ts - - run: name: Jest command: yarn test:coverage --ci --maxWorkers=2 --reporters=default --reporters=jest-junit @@ -66,40 +88,43 @@ references: path: ./coverage destination: coverage -version: 2 jobs: - current: - <<: *base + audit: + executor: node + steps: + - audit - carbon: - <<: *base - docker: - - image: circleci/node:carbon + test-node8: + executor: + name: node + version: '8' + steps: + - test - erbium: - <<: *base - docker: - - image: circleci/node:12 + test-node10: + executor: + name: node + version: '10.16.0' # Specify TLS version for development + steps: + - test - github-release: - <<: *base + test-node12: + executor: + name: node + version: '12' steps: - - checkout - - run: - name: Create release on GitHub - command: curl https://raw.githubusercontent.com/marp-team/marp/master/github-release.js | node + - test workflows: - version: 2 - build: + test: jobs: - - current - - carbon - - erbium - - github-release: - context: github-release - filters: - branches: - ignore: /.*/ - tags: - only: /^v.*/ + - audit + - test-node8: + requires: + - audit + - test-node10: + requires: + - audit + - test-node12: + requires: + - audit From 1042b0f3349c6433391b06bbe9fee159ea7f47b7 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 6 Sep 2019 09:18:44 +0900 Subject: [PATCH 2/3] Update versioning/release to use marp-team/actions --- .github/workflows/github-release.yml | 16 ++++++++++++++++ package.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/github-release.yml diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 00000000..9bd925ba --- /dev/null +++ b/.github/workflows/github-release.yml @@ -0,0 +1,16 @@ +name: GitHub Release + +on: + push: + tags: + - v* + +jobs: + github-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: marp-team/actions@v1 + with: + task: release + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 3a6cd571..a4d32d15 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "test": "jest", "test:coverage": "jest --coverage", "types": "rimraf types && tsc --declaration --emitDeclarationOnly --outDir types", - "version": "curl https://raw.githubusercontent.com/marp-team/marp/master/version.js | node && git add -A CHANGELOG.md", + "version": "curl https://raw.githubusercontent.com/marp-team/actions/v1/lib/scripts/version.js | node && git add -A CHANGELOG.md", "watch": "rollup -w -c" }, "devDependencies": { From 85b4d4465b2a3d867a9af431c2a6da015b9d6f14 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 6 Sep 2019 09:22:36 +0900 Subject: [PATCH 3/3] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9703c8c3..17c02513 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Update CircleCI configuration to use v2.1 ([#101](https://github.com/marp-team/marp-core/pull/101)) + ## v0.12.1 - 2019-08-23 ### Changed