generated from etclabscore/pristine-typescript
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yml
100 lines (89 loc) · 2.58 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
version: 2
aliases:
# -------------------------
# ALIASES: Caches
# -------------------------
- &restore-deps-cache
key: deps-cache-{{ checksum "package.json" }}
- &save-deps-cache
key: deps-cache-{{ checksum "package.json" }}
paths:
- ~/project/node_modules
# -------------------------
# ALIASES: Branch Filters
# -------------------------
- &filter-only-master
branches:
only: master
- &filter-only-semantic-pr
branches:
only: /^(pull|fix|feat|dependabot)\/.*$/
defaults: &defaults
working_directory: ~/project
docker:
- image: cimg/node:20.12.1
jobs:
test:
<<: *defaults
steps:
- checkout
- restore_cache: *restore-deps-cache
- run: npm install
- run: npm test
- save_cache: *save-deps-cache
release:
<<: *defaults
docker:
- image: cimg/python:2.7-node
steps:
- checkout
- run:
name: Swap node versions
command: |
set +e
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v20
nvm alias default 20
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
# Verify Node.js version
- run:
name: Verify Node.js version
command: |
node --version
- run: npm install
- run: ./node_modules/.bin/semantic-release
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Deploy to S3
command: aws s3 mv src/schema.json s3://meta.json-schema.tools/latest.json
- run:
name: invalidate cloudfront
command: aws cloudfront create-invalidation --distribution-id E205UL06VEMZBZ --paths '/*'
- save_cache: *save-deps-cache
release_rust:
<<: *defaults
docker:
- image: circleci/rust
steps:
- checkout
- run: git checkout master && git fetch && git reset --hard origin/master
- run: cargo login $CRATES_API_TOKEN
- run: cargo publish
workflows:
version: 2
release:
jobs:
- release:
filters: *filter-only-master
context: sem-rel-json-schema-tools
- release_rust:
filters: *filter-only-master
context: sem-rel-json-schema-tools
requires:
- release