Skip to content

Commit

Permalink
feat: add release job (#12)
Browse files Browse the repository at this point in the history
* feat: build release pipeline

* chore: various fixes

* chore: generate command-snapshot

* chore: code review

* chore: bump plugin-release-management
  • Loading branch information
mdonnalley authored Jul 8, 2021
1 parent c3a950c commit 1082ac8
Show file tree
Hide file tree
Showing 7 changed files with 1,618 additions and 65 deletions.
153 changes: 142 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,87 @@ version: 2.1
orbs:
release-management: salesforce/npm-release-management@4

jobs:
# There are two pack jobs:
# - test-pack-tarballs to run on every branch *other than main*
# - pack-and-upload-tarballs to run only on main
# The persist_to_workspace feature would allow use to have a
# pack-tarballs and an upload-tarballs job, but the perf gains
# is minimal since the workspace is almost a GB to attach.
test-pack-tarballs:
docker:
- image: node:lts
resource_class: xlarge
steps:
- checkout
- run: |
apt-get update
apt-get install -y p7zip-full
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- run: yarn install
- run: yarn pack:tarballs
- run: yarn pack:verify
- run: yarn test:smoke-unix

pack-and-upload-tarballs: &pack-and-upload-tarballs
docker:
- image: node:lts
resource_class: xlarge
steps:
- checkout
- run: |
apt-get update
apt-get install -y p7zip-full
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- run: yarn install
- run: yarn pack:tarballs
- run: yarn pack:verify
- run: yarn test:smoke-unix
- run: yarn upload:tarballs
- run: |
VERSION=$(node -p -e "require('./package.json').version")
SHA=$(git rev-parse --short HEAD)
yarn promote --version $VERSION --sha $SHA --channel stable --max-age 300
pack-and-upload-macos-installer:
macos:
xcode: 11.7.0
steps:
- checkout
- run: yarn install
- run: yarn pack:macos
- run: yarn upload:macos
- run: |
VERSION=$(node -p -e "require('./package.json').version")
SHA=$(git rev-parse --short HEAD)
yarn promote --version $VERSION --sha $SHA --channel stable --max-age 300 --macos
pack-and-upload-windows-installer:
<<: *pack-and-upload-tarballs
steps:
- checkout
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- run: |
apt-get update
apt-get install -y p7zip-full \
osslsigncode \
nsis
- run: yarn install
- run: |
echo $WINDOWS_SIGNING_KEY | base64 --decode > /tmp/windows-signing.pfx
- run: yarn pack:win
- run: yarn upload:win
- run: |
VERSION=$(node -p -e "require('./package.json').version")
SHA=$(git rev-parse --short HEAD)
yarn promote --version $VERSION --sha $SHA --channel stable --max-age 300 --win
workflows:
version: 2
test-and-release:
Expand All @@ -12,22 +93,72 @@ workflows:
branches:
ignore: main
- release-management/test-package:
name: node-latest
node_version: latest
- release-management/test-package:
name: node-14
- release-management/test-package:
name: node-12
matrix:
parameters:
os:
- linux
- windows
node_version:
- latest
- lts
- maintenance
exclude:
- os: windows
node_version: lts
- os: windows
node_version: maintenance
# TODO: add this back once we're ready to include sf in sfdx
# - release-management/test-plugin-inclusion
- test-pack-tarballs:
# no point to pack if the test fail, and we only care to test the pack with the node version
# we ship (specified in package.json.oclif.node)
requires:
- release-management/test-package
filters:
branches:
ignore: main # test the pack on PRs, but main will do pack-and-upload-tarballs
- approval:
type: approval
requires:
- release-management/test-package
# - release-management/test-plugin-inclusion
- test-pack-tarballs
filters:
branches:
only:
- main
- release-management/release-package:
node_version: '14'
tag: canary
tag: latest
github-release: true
requires:
- approval
filters:
branches:
only: main
pre-job-steps:
- release-management/pin-dependencies:
tag: canary
tag: latest
- pack-and-upload-tarballs:
filters:
branches:
only:
- main
requires:
- release-management/release-package
- pack-and-upload-macos-installer:
filters:
branches:
only:
- main
requires:
- release-management/release-package
- pack-and-upload-tarballs
- pack-and-upload-windows-installer:
filters:
branches:
only:
- main
requires:
- node-latest
- node-14
- node-12
- release-management/release-package
- pack-and-upload-tarballs
146 changes: 145 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ npm install -g @salesforce/cli
$ sf COMMAND
running command...
$ sf (-v|--version|version)
@salesforce/cli/0.0.6 linux-x64 node-v14.17.3
@salesforce/cli/0.0.7 darwin-x64 node-v14.15.4
$ sf --help [COMMAND]
USAGE
$ sf COMMAND
Expand Down Expand Up @@ -53,6 +53,12 @@ USAGE
* [`sf login:org`](#sf-loginorg)
* [`sf login:org:jwt`](#sf-loginorgjwt)
* [`sf logout`](#sf-logout)
* [`sf plugins`](#sf-plugins)
* [`sf plugins:inspect PLUGIN...`](#sf-pluginsinspect-plugin)
* [`sf plugins:install PLUGIN...`](#sf-pluginsinstall-plugin)
* [`sf plugins:link PLUGIN`](#sf-pluginslink-plugin)
* [`sf plugins:uninstall PLUGIN...`](#sf-pluginsuninstall-plugin)
* [`sf plugins:update`](#sf-pluginsupdate)
* [`sf project:deploy`](#sf-projectdeploy)
* [`sf project:deploy:functions`](#sf-projectdeployfunctions)
* [`sf project:deploy:org`](#sf-projectdeployorg)
Expand Down Expand Up @@ -480,6 +486,144 @@ EXAMPLE

_See code: [@salesforce/plugin-login](https://github.com/salesforcecli/plugin-login/blob/v0.0.4/src/commands/logout.ts)_

## `sf plugins`

list installed plugins

```
USAGE
$ sf plugins
OPTIONS
--core show core plugins
EXAMPLE
$ sf plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/index.ts)_

## `sf plugins:inspect PLUGIN...`

displays installation properties of a plugin

```
USAGE
$ sf plugins:inspect PLUGIN...
ARGUMENTS
PLUGIN [default: .] plugin to inspect
OPTIONS
-h, --help show CLI help
-v, --verbose
EXAMPLE
$ sf plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/inspect.ts)_

## `sf plugins:install PLUGIN...`

installs a plugin into the CLI

```
USAGE
$ sf plugins:install PLUGIN...
ARGUMENTS
PLUGIN plugin to install
OPTIONS
-f, --force yarn install with force flag
-h, --help show CLI help
-v, --verbose
DESCRIPTION
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ sf plugins:add
EXAMPLES
$ sf plugins:install myplugin
$ sf plugins:install https://github.com/someuser/someplugin
$ sf plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/install.ts)_

## `sf plugins:link PLUGIN`

links a plugin into the CLI for development

```
USAGE
$ sf plugins:link PLUGIN
ARGUMENTS
PATH [default: .] path to plugin
OPTIONS
-h, --help show CLI help
-v, --verbose
DESCRIPTION
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLE
$ sf plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/link.ts)_

## `sf plugins:uninstall PLUGIN...`

removes a plugin from the CLI

```
USAGE
$ sf plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
OPTIONS
-h, --help show CLI help
-v, --verbose
ALIASES
$ sf plugins:unlink
$ sf plugins:remove
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/uninstall.ts)_

## `sf plugins:update`

update installed plugins

```
USAGE
$ sf plugins:update
OPTIONS
-h, --help show CLI help
-v, --verbose
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.10.1/src/commands/plugins/update.ts)_

## `sf project:deploy`

The command first analyzes your project, active or logged-into environments, and local defaults to determine what to deploy and where. The command then prompts you for information about this particular deployment and provides intelligent choices based on its analysis.
Expand Down
1 change: 1 addition & 0 deletions bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ const oclif = require('@oclif/core');
require('ts-node').register();

oclif.settings.tsnodeEnabled = true;
process.env.NODE_ENV = 'development';

oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
Loading

0 comments on commit 1082ac8

Please sign in to comment.