Skip to content

Commit

Permalink
feat: build release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jul 8, 2021
1 parent c3a950c commit 95a0dc0
Show file tree
Hide file tree
Showing 4 changed files with 1,109 additions and 67 deletions.
132 changes: 127 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,85 @@ 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

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 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 @@ -18,16 +97,59 @@ workflows:
name: node-14
- release-management/test-package:
name: node-12
- 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:
- node-14
filters:
branches:
ignore: main # test the pack on PRs, but main will do pack-and-upload-tarballs
- approval:
type: approval
requires:
- node-latest
- node-14
- node-12
- 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:
- node-latest
- node-14
- node-12
- 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:
- release-management/release-package
- pack-and-upload-tarballs
38 changes: 21 additions & 17 deletions 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 @@ -103,45 +103,49 @@ _See code: [@salesforce/plugin-functions](https://github.com/salesforcecli/plugi

## `sf env:display`

display details for an environment
Display details about a specific environment

```
USAGE
$ sf env:display
OPTIONS
-e, --environment=environment (required) environment name
-e, --environment=environment Environment name or alias to display.
--json format output as json
--verbose verbose display output
EXAMPLE
$ sfdx env:display --environment=billingApp-Scratch1
EXAMPLES
sf env display -e my-scratch-org
sf env display -e [email protected]
```

_See code: [@salesforce/plugin-functions](https://github.com/salesforcecli/plugin-functions/blob/v0.2.16/src/commands/env/display.ts)_
_See code: [@salesforce/plugin-env](https://github.com/salesforcecli/plugin-env/blob/v0.0.7/src/commands/env/display.ts)_

## `sf env:list`

List all environments by type
List the environments you’ve created or logged into.

```
USAGE
$ sf env:list
OPTIONS
-j, --json output list in JSON format
-t, --environment-type=org|scratchorg|compute filter by one or more environment types (org, scratchorg, compute)
--all show all available envs instead of scoping to active orgs and their
connected compute envs
-a, --all Show all environments, including inactive orgs.
-x, --extended show extra columns
--columns=columns only show provided columns (comma-separated)
--csv output is csv format [alias: --output=csv]
--filter=filter filter property by partial string matching, ex: name=foo
--json format output as json
--no-header hide table header from output
--no-truncate do not truncate output to fit screen
--output=csv|json|yaml output in a more machine friendly format
--sort=sort property to sort by (prepend '-' for descending)
EXAMPLES
$ sfdx env:list
$ sfdx env:list --all
$ sfdx env:list --environment-type org --environment-type compute
sf env list
sf env list --all
```

_See code: [@salesforce/plugin-functions](https://github.com/salesforcecli/plugin-functions/blob/v0.2.16/src/commands/env/list.ts)_
_See code: [@salesforce/plugin-env](https://github.com/salesforcecli/plugin-env/blob/v0.0.7/src/commands/env/list.ts)_

## `sf env:log:tail`

Expand Down
43 changes: 39 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,30 @@
"@salesforce/plugin-project-org"
],
"devPlugins": [
"@oclif/plugin-command-snapshot"
]
"@oclif/plugin-command-snapshot",
"@salesforce/plugin-release-management"
],
"update": {
"s3": {
"bucket": "dfc-data-production",
"indexVersionLimit": 20,
"folder": "media/salesforce-cli/sf",
"acl": " ",
"host": "https://developer.salesforce.com"
}
},
"macos": {
"identifier": "com.salesforce.cli"
},
"windows": {
"name": "Salesforce CLI",
"keypath": "/tmp/windows-signing.pfx"
}
},
"dependencies": {
"@oclif/core": "^0.5.20",
"@oclif/plugin-help": "^3.2.2",
"@oclif/plugin-not-found": "^2",
"@oclif/plugin-not-found": "^2.1.0",
"@salesforce/plugin-env": "0.0.7",
"@salesforce/plugin-functions": "0.2.16",
"@salesforce/plugin-login": "0.0.4",
Expand All @@ -60,16 +77,32 @@
"repository": "salesforcecli/cli",
"scripts": {
"build": "sf-build",
"clean": "sf-clean",
"clean-all": "-clean all",
"clean": "sf-clean",
"compile": "sf-compile",
"docs": "sf-docs",
"format": "sf-format",
"lint": "sf-lint",
"oclif-artifacts": "oclif manifest",
"pack:deb": "oclif pack:deb",
"pack:macos": "oclif pack:macos",
"pack:tarballs": "oclif pack:tarballs",
"pack:verify": "bin/run cli:tarballs:verify --cli sf",
"pack:win": "oclif pack:win",
"postpack": "rm -f oclif.manifest.json",
"prepack": "yarn build && oclif-dev manifest && oclif-dev readme",
"prepare": "yarn compile && yarn lint",
"pretarball": " bin/run cli:tarballs:prepare",
"pretest": "sf-compile-test",
"promote": "oclif promote",
"promote:verify": "bin/run cli:versions:inspect --channel stable --location archive --cli sf",
"snapshot-generate": "HOME=./ ./bin/run snapshot:generate",
"test:deprecation-policy": "set HOME=./ ./bin/run snapshot:compare",
"test": "echo disable # sf-test",
"upload:deb": "oclif upload:deb",
"upload:macos": "oclif upload:macos",
"upload:tarballs": "oclif upload:tarballs",
"upload:win": "oclif upload:win",
"version": "oclif-dev readme && git add README.md"
},
"types": "lib/index.d.ts",
Expand All @@ -86,9 +119,11 @@
"@oclif/test": "^1",
"@salesforce/dev-config": "^2.1.2",
"@salesforce/dev-scripts": "^0.9.15",
"@salesforce/plugin-release-management": "^1.13.8",
"@salesforce/prettier-config": "^0.0.2",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"aws-sdk": "^2.920.0",
"chai": "^4.3.4",
"eslint": "^7.29.0",
"eslint-config-oclif": "^3.1",
Expand Down
Loading

0 comments on commit 95a0dc0

Please sign in to comment.