Skip to content

Commit b30a06d

Browse files
cortinicofotos
authored andcommitted
chore: update the orb development kit
1 parent 43c7903 commit b30a06d

File tree

2 files changed

+73
-66
lines changed

2 files changed

+73
-66
lines changed

.circleci/config.yml

Lines changed: 22 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,28 @@
11
version: 2.1
2-
2+
setup: true
33
orbs:
4-
cli: circleci/[email protected]
5-
orb-tools: circleci/orb-tools@2
4+
orb-tools: circleci/[email protected]
5+
shellcheck: circleci/[email protected]
66

7-
jobs:
8-
pack:
9-
executor: cli/default
10-
steps:
11-
- checkout
12-
- orb-tools/pack:
13-
source: src/
14-
destination: packed-orb.yml
15-
- orb-tools/validate:
16-
orb-path: packed-orb.yml
17-
- store_artifacts:
18-
path: packed-orb.yml
19-
- persist_to_workspace:
20-
root: .
21-
paths: .
22-
publish:
23-
docker:
24-
- image: cimg/node:12.22
25-
steps:
26-
- attach_workspace:
27-
at: .
28-
- run:
29-
name: Install latest CircleCI CLI
30-
command: |
31-
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | DESTDIR=~ bash
32-
which ~/circleci
33-
~/circleci --help
34-
- restore_cache:
35-
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
36-
- run:
37-
name: Yarn Install
38-
command: yarn install --non-interactive --cache-folder /tmp/yarn
39-
- save_cache:
40-
paths:
41-
- /tmp/yarn
42-
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
43-
- run:
44-
name: Add Github to known hosts
45-
command: |
46-
mkdir -p ~/.ssh
47-
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
48-
- run:
49-
name: Publish to CircleCI Orb Registry
50-
command: yarn semantic-release
7+
filters: &filters
8+
tags:
9+
only: /.*/
5110

5211
workflows:
53-
btd:
12+
lint-pack:
5413
jobs:
55-
- pack
56-
57-
- orb-tools/publish:
58-
orb-path: packed-orb.yml
59-
orb-ref: "react-native-community/react-native@dev:${CIRCLE_BRANCH}"
60-
publish-token-variable: CIRCLECI_API_TOKEN
61-
attach-workspace: true
62-
checkout: false
63-
requires: [pack]
64-
filters:
65-
branches:
66-
ignore: master
67-
68-
- publish:
69-
requires: [pack]
70-
filters:
71-
branches:
72-
only: master
14+
- orb-tools/lint:
15+
filters: *filters
16+
- orb-tools/pack:
17+
filters: *filters
18+
- orb-tools/review:
19+
filters: *filters
20+
- shellcheck/check:
21+
filters: *filters
22+
# Triggers the next workflow in the Orb Development Kit.
23+
- orb-tools/continue:
24+
pipeline_number: << pipeline.number >>
25+
vcs_type: << pipeline.project.type >>
26+
orb_name: <orb-name>
27+
requires: [orb-tools/lint, orb-tools/pack, orb-tools/review, shellcheck/check]
28+
filters: *filters

.circleci/test-deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 2.1
2+
orbs:
3+
# Your orb will be automatically injected here during the pipeline.
4+
# Reference your orb's jobs and commands below as they will exist when built.
5+
orb-tools: circleci/[email protected]
6+
# The orb definition is intentionally not included here. It will be injected into the pipeline.
7+
<orb-name>: {}
8+
9+
# Use this tag to ensure test jobs always run,
10+
# even though the downstream publish job will only run on release tags.
11+
filters: &filters
12+
tags:
13+
only: /.*/
14+
15+
# Filter for release tags.
16+
release-filters: &release-filters
17+
branches:
18+
ignore: /.*/
19+
tags:
20+
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
21+
22+
jobs:
23+
# Create jobs to test the commands of your orbs.
24+
# You may want to add additional validation steps to ensure the commands are working as expected.
25+
command-test:
26+
docker:
27+
- image: cimg/base:current
28+
steps:
29+
- checkout
30+
# Run your orb's commands to validate them.
31+
- yarn_install
32+
workflows:
33+
test-deploy:
34+
jobs:
35+
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
36+
# Test your orb's commands in a custom job and test your orb's jobs directly as a part of this workflow.
37+
- command-test:
38+
filters: *filters
39+
# The orb must be re-packed for publishing, and saved to the workspace.
40+
- orb-tools/pack:
41+
filters: *release-filters
42+
- orb-tools/publish:
43+
orb_name: react-native-community/react-native
44+
vcs_type: << pipeline.project.type >>
45+
pub_type: production
46+
# Ensure this job requires all test jobs and the pack job.
47+
requires:
48+
- orb-tools/pack
49+
- command-test
50+
context: <publishing-context>
51+
filters: *release-filters

0 commit comments

Comments
 (0)