Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support latest-rc releases #78

Merged
merged 18 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 65 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
version: 2.1
orbs:
release-management: salesforce/npm-release-management@4
jq: circleci/[email protected]

jobs:
change-case-start:
Expand Down Expand Up @@ -29,6 +30,8 @@ jobs:
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- release-management/install-sf-release
- run: sf-release npm:dependencies:pin --tag latest-rc
- run: yarn install
- run: yarn pack:tarballs
- run: yarn pack:verify
Expand All @@ -52,12 +55,7 @@ jobs:
- run: yarn pack:verify
- run: yarn test:smoke-unix
- run: yarn upload:tarballs
- run:
name: Promote to stable channel
command: |
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 --indexes
- run: yarn channel:promote --cli sf --sha $CIRCLE_SHA1 --target stable-rc --platform deb

pack-and-upload-macos-installer:
macos:
Expand All @@ -68,12 +66,7 @@ jobs:
- run: yarn install
- run: yarn pack:macos
- run: yarn upload:macos
- run:
name: Promote macos installer to stable channel
command: |
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 --indexes
- run: yarn channel:promote --cli sf --sha $CIRCLE_SHA1 --target stable-rc --platform macos

pack-and-upload-windows-installer:
<<: *pack-and-upload-tarballs
Expand All @@ -93,12 +86,27 @@ jobs:
echo $WINDOWS_SIGNING_KEY | base64 --decode > /tmp/windows-signing.pfx
- run: yarn pack:win
- run: yarn upload:win
- run:
name: Promote windows installer to stable channel
command: |
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 --indexes
- run: yarn channel:promote --cli sf --sha $CIRCLE_SHA1 --target stable-rc --platform win
promote-channels:
docker:
- image: node:lts
steps:
- checkout
- jq/install
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- run: yarn install
- run: yarn channel:promote --candidate stable-rc --target stable --cli sf --indexes --platform macos,win,deb
npm-promotions:
docker:
- image: node:latest
steps:
- checkout
- jq/install
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
# if you try to use yarn here, it will attempt to use the wrong registry and throw 401s
- run: npm run promote-dist-tags

promote-verify:
docker:
Expand Down Expand Up @@ -140,32 +148,36 @@ workflows:
filters:
branches:
ignore: main
- release-management/test-sf-inclusion:
name: test-include-sf-in-sdx
- test-pack-tarballs:
filters:
branches:
ignore: main # test the pack on PRs, but main will do pack-and-upload-tarballs
- approval:
type: approval
filters:
branches:
only:
- main
- change-case-start:
context: CLI_CTC
requires:
- test-include-sf-in-sdx
- approval
filters:
branches:
only: main
- release-management/release-package:
node_version: '14'
tag: latest
tag: latest-rc
github-release: true
requires:
- approval
- change-case-start
- test-include-sf-in-sdx
filters:
branches:
only: main
pre-job-steps:
- release-management/pin-dependencies:
tag: latest
tag: latest-rc
peternhale marked this conversation as resolved.
Show resolved Hide resolved
- pack-and-upload-tarballs:
filters:
branches:
Expand Down Expand Up @@ -220,3 +232,32 @@ workflows:
jobs:
- release-management/dependabot-automerge:
skip-ci: true
promote-to-latest:
triggers:
- schedule:
# Wednesday mornings at 10am mountain
cron: '0 16 * * 3'
filters:
branches:
only:
- main
jobs:
# start the change case
- change-case-start:
context: CLI_CTC
- promote-channels:
requires:
- change-case-start
- npm-promotions:
requires:
- change-case-start
# close change case
- close-CTC:
context: CLI_CTC
requires:
- promote-verify
# verify the npm tags and installers are on the right version
- promote-verify:
requires:
- npm-promotions
- promote-channels
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.1.0](https://github.com/salesforcecli/cli/compare/v1.0.7...v1.1.0) (2021-10-20)

### [1.0.7](https://github.com/salesforcecli/cli/compare/v1.0.6...v1.0.7) (2021-10-14)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ npm install -g @salesforce/cli
$ sf COMMAND
running command...
$ sf (--version|-v|version)
@salesforce/cli/1.0.6 linux-x64 node-v14.18.1
@salesforce/cli/1.1.0 linux-x64 node-v14.18.1
$ sf --help [COMMAND]
USAGE
$ sf COMMAND
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/cli",
"description": "The Salesforce CLI",
"version": "1.0.7",
"version": "1.1.0",
"author": "Salesforce",
"bin": {
"sf": "./bin/run"
Expand Down Expand Up @@ -82,7 +82,7 @@
"@sf/deploy-retrieve": "npm:@salesforce/[email protected]",
"@sf/drm": "npm:@salesforce/[email protected]",
"@sf/env": "npm:@salesforce/[email protected]",
"@sf/functions": "npm:@salesforce/[email protected].4",
"@sf/functions": "npm:@salesforce/[email protected].5",
"@sf/gen": "npm:@salesforce/[email protected]",
"@sf/login": "npm:@salesforce/[email protected]",
"tslib": "^2.3.1"
Expand All @@ -103,6 +103,7 @@
"repository": "salesforcecli/cli",
"scripts": {
"build": "sf-build",
"channel:promote": "sf-release channel:promote",
peternhale marked this conversation as resolved.
Show resolved Hide resolved
"clean-all": "sf-clean all",
"clean": "sf-clean",
"compile": "sf-compile",
Expand All @@ -120,7 +121,7 @@
"prepack": "sf-prepack",
"prepare": "yarn compile && yarn lint",
"pretarball": "./bin/dev cli:tarballs:prepare --types",
"promote": "oclif promote",
"promote-dist-tags": "./scripts/promote-dist-tags",
"promote:verify": "./bin/dev cli:versions:inspect --channels stable --locations archive --cli sf",
"test:smoke-unix": "./tmp/sf/bin/sf --version && ./tmp/sf/bin/sf help && ./tmp/sf/bin/sf plugins --core",
"test:deprecation-policy": "./bin/dev snapshot:compare",
Expand All @@ -144,7 +145,7 @@
"@oclif/test": "^1",
"@salesforce/dev-config": "^2.1.2",
"@salesforce/dev-scripts": "^0.9.18",
"@salesforce/plugin-release-management": "^2.2.2",
"@salesforce/plugin-release-management": "^2.5.1",
"@salesforce/prettier-config": "^0.0.2",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
Expand Down
2 changes: 2 additions & 0 deletions scripts/promote-dist-tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CLI_RC_VERSION=$(npm show @salesforce/cli@latest-rc version)
npm dist-tag add @salesforce/cli@${CLI_RC_VERSION} latest
Loading