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 8 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: 68 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
version: 2.1
orbs:
release-management: salesforce/npm-release-management@4
release-management: salesforce/npm-release-management@dev:2c044f7
peternhale marked this conversation as resolved.
Show resolved Hide resolved
jq: circleci/[email protected]

jobs:
change-case-start:
Expand Down Expand Up @@ -52,12 +53,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
peternhale marked this conversation as resolved.
Show resolved Hide resolved
peternhale marked this conversation as resolved.
Show resolved Hide resolved

pack-and-upload-macos-installer:
macos:
Expand All @@ -68,12 +64,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 --platform macos --target stable-rc

pack-and-upload-windows-installer:
<<: *pack-and-upload-tarballs
Expand All @@ -93,12 +84,28 @@ 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 --platform win --target stable-rc
promote-channels:
docker:
- image: node:lts
steps:
- checkout
- jq/install
- restore_cache:
keys:
- v3-npm-{{checksum "yarn.lock"}}
- run: yarn install
# - run: ./scripts/promote-rc-to-latest
- run: yarn channel-promote --candidate stable-rc --target stable --cli sf
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 @@ -142,30 +149,41 @@ workflows:
ignore: main
- release-management/test-sf-inclusion:
name: test-include-sf-in-sdx
tag: latest-rc
- test-pack-tarballs:
filters:
branches:
ignore: main # test the pack on PRs, but main will do pack-and-upload-tarballs
- approval:
type: approval
requires:
- test-pack-tarballs
peternhale marked this conversation as resolved.
Show resolved Hide resolved
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 +238,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
10 changes: 5 additions & 5 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 @@ -135,8 +136,7 @@
"husky": {
"hooks": {
"commit-msg": "sf-husky-commit-msg",
"pre-commit": "sf-husky-pre-commit",
"pre-push": "sf-husky-pre-push"
RodEsp marked this conversation as resolved.
Show resolved Hide resolved
"pre-commit": "sf-husky-pre-commit"
}
},
"devDependencies": {
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
26 changes: 26 additions & 0 deletions scripts/promote-rc-to-latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# this script will read from a stable-rc channel to get the sha/version. You can override them with env vars.
# make sure you want what's at that url (watch out for caching if you just promoted to stable-rc!)
set -ex

CHANNEL=stable

CLI_RC_VERSION=${S3_PROMOTE_OVERRIDE_VERSION}
SHA_SHORT=${S3_PROMOTE_OVERRIDE_SHA}
MANIFEST_URL="https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable-rc/sf-darwin-x64-buildmanifest"

if [ -z "${S3_PROMOTE_OVERRIDE_VERSION}" ]; then
CLI_RC_VERSION=$(curl -s $MANIFEST_URL | jq -cr '.version')
fi
echo "version to promote: $CLI_RC_VERSION"

if [ -z "${S3_PROMOTE_OVERRIDE_SHA}" ]; then
SHA_SHORT=$(curl -s $MANIFEST_URL | jq -cr '.sha')
fi
echo "will use sha of ${SHA_SHORT}"

echo "will run command"
echo "yarn promote --version $CLI_RC_VERSION --sha $SHA_SHORT --channel $CHANNEL --max-age 300 --macos --win --indexes"

# promote it (runs oclif promote)
yarn promote --version $CLI_RC_VERSION --sha $SHA_SHORT --channel $CHANNEL --max-age 300 --macos --win --indexes
10 changes: 10 additions & 0 deletions scripts/promote-stable-rc-mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -ex

channel="stable-rc"
version=$(node -p -e "require('./package.json').version")
sha=$(git rev-parse --short HEAD)
echo "Promoting $version-$sha to channel $channel"
# 300 = 5 minutes
yarn promote --version $version --sha $sha --channel $channel --max-age 300 --macos
peternhale marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions scripts/promote-stable-rc-tarballs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -ex

channel="stable-rc"
version=$(node -p -e "require('./package.json').version")
sha=$(git rev-parse --short HEAD)
echo "Promoting $version-$sha to channel $channel"
# 300 = 5 minutes
yarn promote --version $version --sha $sha --channel $channel --max-age 300
peternhale marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions scripts/promote-stable-rc-win
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -ex

channel="stable-rc"
version=$(node -p -e "require('./package.json').version")
sha=$(git rev-parse --short HEAD)
echo "Promoting $version-$sha to channel $channel"
# 300 = 5 minutes
yarn promote --version $version --sha $sha --channel $channel --max-age 300 --win
peternhale marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1386,10 +1386,10 @@
open "^8.2.0"
tslib "^2"

"@sf/functions@npm:@salesforce/[email protected].4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@salesforce/plugin-functions/-/plugin-functions-1.1.4.tgz#395c63f82bfb6140e4e96a72df71fb2ce7b21f35"
integrity sha512-mizG6G7NiyBQaBsey26ULq4Y3cjqQO5Und5qfl1+Uod2gyP6Gm62f4KCYCDGxsdq3fT8RWgt4SE2ByaDWpQFww==
"@sf/functions@npm:@salesforce/[email protected].5":
version "1.1.5"
resolved "https://registry.npmjs.org/@salesforce/plugin-functions/-/plugin-functions-1.1.5.tgz#87a5e60be466e0c574c81f26e249c585a7b05231"
integrity sha512-Pj60uV+35Pb7O+yFrKyc1gxsdG3Au47xSIlBJEY0foz3uRI2zsDc3vhR18EHB2Fh7uxnpoeh39nQe3Qhl5h0HA==
dependencies:
"@heroku-cli/color" "^1.1.14"
"@heroku-cli/schema" "^1.0.25"
Expand Down