Skip to content

Commit

Permalink
chore(ci): Release using semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-oakes committed Mar 25, 2019
1 parent 508d6d6 commit 81f8f67
Show file tree
Hide file tree
Showing 5 changed files with 5,279 additions and 17 deletions.
65 changes: 50 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,68 @@
version: 2.1

orbs:
cli: circleci/circleci-cli@0.1.2
orb-tools: circleci/orb-tools@2

jobs:
pack:
executor: cli/default
steps:
- checkout
- orb-tools/pack:
source: src/
destination: packed-orb.yml
- orb-tools/validate:
orb-path: packed-orb.yml
- store_artifacts:
path: packed-orb.yml
- persist_to_workspace:
root: .
paths: .
publish:
docker:
- image: circleci/node:8
environment:
- PATH: '/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
steps:
- attach_workspace:
at: .
- restore_cache:
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Yarn Install
command: yarn install --non-interactive --cache-folder ~/.cache/yarn
- save_cache:
paths:
- ~/.cache/yarn
key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Add Github to known hosts
command: |
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
- run:
name: Publish to NPM
command: yarn semantic-release

workflows:
btd:
jobs:
- orb-tools/pack:
source-dir: src/
destination-orb-path: packed-orb.yml
workspace-path: packed-orb.yml
artifact-path: packed-orb.yml
- pack

- orb-tools/publish:
orb-path: packed-orb.yml
orb-ref: "react-native-community/react-native@dev:${CIRCLE_BRANCH}"
publish-token-variable: "$CIRCLECI_API_TOKEN"
publish-token-variable: CIRCLECI_API_TOKEN
attach-workspace: true
checkout: false
requires: [orb-tools/pack]
requires: [pack]
filters:
branches:
ignore: master

- orb-tools/increment:
orb-path: packed-orb.yml
orb-ref: "react-native-community/react-native"
segment: "patch"
publish-token-variable: "$CIRCLECI_API_TOKEN"
attach-workspace: true
checkout: false
requires: [orb-tools/pack]
- publish:
requires: [pack]
filters:
branches:
only: master
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,130 @@

# Created by https://www.gitignore.io/api/macos,windows,linux,node

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/macos,windows,linux,node

/packed-orb.yml
21 changes: 21 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"semantic-release-circleci-orb",
{
"orbName": "react-native-community/circleci-orb",
"orbPath": "packed-orb.yml"
}
],
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": "package.json",
"message": "chore(release): ${nextRelease.version} [skip ci] \n\n${nextRelease.notes}"
}
]
]
}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
"private": true,
"description": "A CircleCI Orb which can be used to simplify building and testing React Native apps.",
"scripts": {
"pack": "./scripts/pack.sh"
"pack": "./scripts/pack.sh",
"semantic-release": "semantic-release"
},
"devDependencies": {
"@semantic-release/git": "^7.0.8",
"semantic-release": "^15.13.3",
"semantic-release-circleci-orb": "^1.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/react-native-community/react-native-circleci-orb.git"
"url": "https://github.com/react-native-community/react-native-circleci-orb.git"
},
"author": "Matt Oakes <hello@mattoakes.net>",
"license": "MIT",
Expand Down
Loading

0 comments on commit 81f8f67

Please sign in to comment.