This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
/
config.yml
101 lines (100 loc) · 3.19 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
version: 2.1
orbs:
node: circleci/node@4.7.0
jobs:
test-node: &test
parameters:
node-version:
type: string
description: "node.js version to install"
docker:
- image: oclif/nsis:12.0.0-16
working_directory: ~/cli
environment:
NYC: "yarn exec nyc -- --nycrc-path node_modules/@oclif/nyc-config/.nycrc"
steps:
- checkout
- run: &setup_yarn
name: Setup Yarn
command: |
mkdir -p .yarn
echo "--install.cache-path $(pwd)/.yarn/cache" >> .yarnrc
echo "--install.prefer-offline" >> .yarnrc
echo "yarn-offline-mirror $(pwd)/.yarn/offline-mirror" >> .yarnrc
- node/install: &install_node
node-version: << parameters.node-version >>
- run:
name: Yarn Install
command: |
npm install yarn -g
- run: &create_cache_key_file
name: "Create Cache Key File"
command: |
echo "node: $(node --version)" >> .circleci-cache-key
echo "yarn: $(yarn --version)" >> .circleci-cache-key
echo "yarnrc: $(sha256sum .yarnrc)" >> .circleci-cache-key
echo ".circleci/config.yml: $(sha256sum .circleci/config.yml)" >> .circleci-cache-key
- node/install-packages: &install_node_packages
cache-path: ".yarn"
cache-version: &cache_key |
{{checksum ".circleci-cache-key"}}
pkg-manager: yarn
include-branch-in-cache-key: false
- run: 'echo "Node: `node --version`"'
- run: .circleci/loadgpg
- run: yarn add -D nyc@13 @oclif/nyc-config@1
- run: ./node_modules/.bin/tsc
- run: ./bin/run --version
- run: ./bin/run --help
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- run: *setup_yarn
- node/install: *install_node
- run:
name: Yarn Install
command: |
npm install yarn -g
- run: *create_cache_key_file
- node/install-packages: *install_node_packages
- run: .circleci/loadgpg
- run: yarn global add @oclif/semantic-release@3 semantic-release@17
- run: yarn --frozen-lockfile
- run: ./bin/run pack
- run: ./bin/run pack:deb
- run: ./bin/run pack:win
# - run: ./bin/run publish
# - run: ./bin/run publish:deb
# - run: ./bin/run publish:win
- run: |
export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH
semantic-release -e @oclif/semantic-release
- run: yarn add -D nyc@13 @oclif/nyc-config@1
- save_cache:
key: v6-yarn-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- ~/cli/tmp/cache
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn
workflows:
version: 2.1
build:
jobs:
- test-node:
matrix:
parameters:
node-version:
- "12"
- "14"
- "16"
- release:
node-version: "14"
context: SF-CLI-RELEASE-PROCESS
filters:
branches: {only: main}
requires:
- test-node