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

ci: fix pre-release and tagged release #313

Merged
merged 1 commit into from
Dec 16, 2021
Merged

ci: fix pre-release and tagged release #313

merged 1 commit into from
Dec 16, 2021

Conversation

dpilch
Copy link
Contributor

@dpilch dpilch commented Dec 16, 2021

No longer use the canary option because it is broken.

Now manually create a pre-release version number and then use lerna publish from-git.

Other changes:

  • Will always publish a new pre-release (even if there are no changes to source).
  • Change pre-release alpha preid to short commit hash.
  • Use tagged release name as dist tag
  • Add short commit hash to tagged release preid.

Tested locally when unauthenticated.

Pre-release

> export CIRCLE_BRANCH = test-pre-relase
> bash -x .circleci/publish.sh 
++ git log --format=%s -n 1
+ [[ feat: something =~ ^chore\(release\): v.* ]]
++ echo adc94308d775618e29c84a8fbd2380bb5dfd181b
++ cut -c -7
+ SHORT_SHA1=adc9430
+ [[ fix-prerelease =~ ^tagged-release/.* ]]
+ npx lerna version prerelease --amend --ignore-scripts --no-commit-hooks --preid adc9430 -y
lerna notice cli v4.0.0
lerna info current version 1.2.0
lerna info Looking for changed packages since @amzn/amplify-ui-codegen-schema@0.1.0
lerna WARN version Skipping working tree validation, proceed at your own risk

Changes:
 - @aws-amplify/codegen-ui-react: 1.2.0 => 1.2.1-adc9430.0
 - @aws-amplify/codegen-ui: 1.2.0 => 1.2.1-adc9430.0
 - @aws-amplify/codegen-ui-test-generator: 1.2.0 => 1.2.1-adc9430.0 (private)

lerna info auto-confirmed 
lerna info execute Skipping git push
lerna info execute Skipping releases

You need a passphrase to unlock the secret key for
user: "Dane Pilcher <dppilche@amazon.com>"
4096-bit RSA key, ID D729AEB7, created 2021-08-23

lerna success version finished
+ npx lerna publish from-git --ignore-scripts --pre-dist-tag next -y
lerna notice cli v4.0.0

Found 2 packages to publish:
 - @aws-amplify/codegen-ui-react => 1.2.1-adc9430.0
 - @aws-amplify/codegen-ui => 1.2.1-adc9430.0

lerna info auto-confirmed 
lerna info publish Publishing packages to npm...
lerna info Verifying npm credentials
lerna http fetch GET 401 https://registry.npmjs.org/-/npm/v1/user 84ms
401 Unauthorized - GET https://registry.npmjs.org/-/npm/v1/user
lerna ERR! EWHOAMI Authentication error. Use `npm whoami` to troubleshoot.

Tagged Release

> export CIRCLE_BRANCH = tagged-release/test-tagged
> bash -x .circleci/publish.sh 
++ git log --format=%s -n 1
+ [[ feat: something =~ ^chore\(release\): v.* ]]
++ echo adc94308d775618e29c84a8fbd2380bb5dfd181b
++ cut -c -7
+ SHORT_SHA1=adc9430
+ [[ tagged-release/test-tagged =~ ^tagged-release/.* ]]
++ echo tagged-release/test-tagged
++ sed 's:.*/::'
+ TAGGED_RELEASE_NAME=test-tagged
+ npx lerna version prerelease --amend --ignore-scripts --no-commit-hooks --preid test-tagged-adc9430 -y
lerna notice cli v4.0.0
lerna info current version 1.2.0
lerna info Looking for changed packages since @amzn/amplify-ui-codegen-schema@0.1.0
lerna WARN version Skipping working tree validation, proceed at your own risk

Changes:
 - @aws-amplify/codegen-ui-react: 1.2.0 => 1.2.1-test-tagged-adc9430.0
 - @aws-amplify/codegen-ui: 1.2.0 => 1.2.1-test-tagged-adc9430.0
 - @aws-amplify/codegen-ui-test-generator: 1.2.0 => 1.2.1-test-tagged-adc9430.0 (private)

lerna info auto-confirmed 
lerna info execute Skipping git push
lerna info execute Skipping releases

You need a passphrase to unlock the secret key for
user: "Dane Pilcher <dppilche@amazon.com>"
4096-bit RSA key, ID D729AEB7, created 2021-08-23

lerna success version finished
+ npx lerna publish from-git --ignore-scripts --pre-dist-tag test-tagged -y
lerna notice cli v4.0.0

Found 2 packages to publish:
 - @aws-amplify/codegen-ui-react => 1.2.1-test-tagged-adc9430.0
 - @aws-amplify/codegen-ui => 1.2.1-test-tagged-adc9430.0

lerna info auto-confirmed 
lerna info publish Publishing packages to npm...
lerna info Verifying npm credentials
lerna http fetch GET 401 https://registry.npmjs.org/-/npm/v1/user 106ms
401 Unauthorized - GET https://registry.npmjs.org/-/npm/v1/user
lerna ERR! EWHOAMI Authentication error. Use `npm whoami` to troubleshoot.

@dpilch dpilch requested a review from a team December 16, 2021 17:24
@dpilch dpilch merged commit 9893c5d into develop Dec 16, 2021
@dpilch dpilch deleted the fix-prerelease branch December 16, 2021 22:15
dpilch added a commit that referenced this pull request Dec 16, 2021
@dpilch dpilch mentioned this pull request Feb 24, 2022
@alharris-at alharris-at mentioned this pull request Feb 24, 2022
alharris-at pushed a commit that referenced this pull request Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants