Skip to content

Commit

Permalink
Feature/yarn-publish-version (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tedezed authored Oct 1, 2024
1 parent 1ff5e8d commit 287788b
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 24 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
matrix:
include:
- node-version: 18.x
publish: true
publish: false
- node-version: 20.x
publish: true # TODO
- node-version: 22.x
publish: true
publish: false

env:
CI: true
Expand Down Expand Up @@ -86,27 +86,45 @@ jobs:
console.log(`Release type: ${releaseType}`)
return releaseType
- name: Set version from tag to environment variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

# TODO: Enable after reaching 1.0.0.
# This may indicate that the tag set has a typo, e.g., alpah, betta, etc.
# - name: Verify tag format
# if: steps.check-tag-format.outputs.is_stable == 'false' && steps.get-release-type.outputs.result == 'latest'
# run: echo "Tag set may be incorrect. Please, review" && exit 1

# - name: Reset changes
# if: startsWith(github.ref, 'refs/tags/') && matrix.publish
# run: git reset --hard HEAD

- name: Ignore changes to .yarnrc.yml
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
run: git update-index --assume-unchanged .yarnrc.yml

- name: Configure yarn to publish packages
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
env:
# The following token has been manually issued in the CartoDB
# organization for npmjs.com
NODE_AUTH_TOKEN: ${{ secrets.NPM_CARTODB_AUTH_TOKEN }}
run: |
# Yarn config
yarn config set npmPublishRegistry "https://registry.npmjs.org/"
yarn config set npmAuthToken "${NODE_AUTH_TOKEN}"
# Create .npmrc file
echo "@carto:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
# Check configuration
npm config get registry
npm view @carto/create-common versions
- name: Publish package with Lerna
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
env:
RELEASE_TYPE: ${{ steps.get-release-type.outputs.result }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_CARTODB_AUTH_TOKEN }}
run: |
set -x
yarn lerna publish --yes --force-publish "*" --dist-tag ${RELEASE_TYPE} --no-git-tag-version
yarn lerna publish from-git --yes --dist-tag ${RELEASE_TYPE} --loglevel verbose
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"clean": "rimraf --glob 'packages/*/dist/*' 'sandbox/*'",
"preversion": "yarn lint",
"version": "yarn clean && yarn build",
"postpublish": "git push && git push --tags"
"postversion": "git push && git push --tags"
},
"devDependencies": {
"@types/meow": "^6.0.0",
Expand All @@ -24,7 +24,7 @@
"meow": "^13.2.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"typescript": "^5.6.2",
"typescript": "5.5.4",
"vite": "^5.4.6"
},
"resolutions": {
Expand Down
7 changes: 4 additions & 3 deletions packages/create-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <[email protected]>",
"license": "MIT",
"version": "0.0.12",
"version": "0.0.13-0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -25,7 +25,7 @@
"@angular/router": "^18.2.5",
"@auth0/auth0-angular": "^2.2.3",
"@carto/api-client": "^0.1.0",
"@carto/create-common": "^0.0.12",
"@carto/create-common": "^0.0.13-0",
"@deck.gl/aggregation-layers": "^9.0.24",
"@deck.gl/carto": "^9.0.24",
"@deck.gl/core": "^9.0.24",
Expand All @@ -49,5 +49,6 @@
"typescript": "<5.6.0"
},
"packageManager": "[email protected]",
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77"
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
"stableVersion": "0.0.12"
}
5 changes: 3 additions & 2 deletions packages/create-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@carto/create-common",
"packageManager": "[email protected]",
"author": "Don McCurdy <[email protected]>",
"version": "0.0.12",
"version": "0.0.13-0",
"license": "MIT",
"type": "module",
"sideEffects": false,
Expand Down Expand Up @@ -49,5 +49,6 @@
"@types/prompts": "^2.4.9",
"microbundle": "^0.15.1"
},
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77"
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
"stableVersion": "0.0.12"
}
7 changes: 4 additions & 3 deletions packages/create-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <[email protected]>",
"license": "MIT",
"version": "0.0.12",
"version": "0.0.13-0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -17,7 +17,7 @@
"dependencies": {
"@auth0/auth0-react": "^2.2.4",
"@carto/api-client": "^0.1.0",
"@carto/create-common": "^0.0.12",
"@carto/create-common": "^0.0.13-0",
"@deck.gl/aggregation-layers": "^9.0.24",
"@deck.gl/carto": "^9.0.24",
"@deck.gl/core": "^9.0.24",
Expand Down Expand Up @@ -50,5 +50,6 @@
"vite": "^5.4.6"
},
"packageManager": "[email protected]",
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77"
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
"stableVersion": "0.0.12"
}
7 changes: 4 additions & 3 deletions packages/create-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-app-templates",
"author": "Don McCurdy <[email protected]>",
"license": "MIT",
"version": "0.0.12",
"version": "0.0.13-0",
"type": "module",
"bin": "./scripts/create.js",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"dependencies": {
"@auth0/auth0-vue": "^2.3.3",
"@carto/api-client": "^0.1.0",
"@carto/create-common": "^0.0.12",
"@carto/create-common": "^0.0.13-0",
"@deck.gl/aggregation-layers": "^9.0.24",
"@deck.gl/carto": "^9.0.24",
"@deck.gl/core": "^9.0.24",
Expand All @@ -41,5 +41,6 @@
"vue-tsc": "^2.1.6"
},
"packageManager": "[email protected]",
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77"
"gitHead": "eee3523a24885fe41609c9739378a10dc90dab77",
"stableVersion": "0.0.12"
}
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ __metadata:
"@angular/router": "npm:^18.2.5"
"@auth0/auth0-angular": "npm:^2.2.3"
"@carto/api-client": "npm:^0.1.0"
"@carto/create-common": "npm:^0.0.12"
"@carto/create-common": "npm:^0.0.13-0"
"@deck.gl/aggregation-layers": "npm:^9.0.24"
"@deck.gl/carto": "npm:^9.0.24"
"@deck.gl/core": "npm:^9.0.24"
Expand All @@ -2457,7 +2457,7 @@ __metadata:
languageName: unknown
linkType: soft

"@carto/create-common@npm:^0.0.12, @carto/create-common@workspace:packages/create-common":
"@carto/create-common@npm:^0.0.13-0, @carto/create-common@workspace:packages/create-common":
version: 0.0.0-use.local
resolution: "@carto/create-common@workspace:packages/create-common"
dependencies:
Expand All @@ -2477,7 +2477,7 @@ __metadata:
dependencies:
"@auth0/auth0-react": "npm:^2.2.4"
"@carto/api-client": "npm:^0.1.0"
"@carto/create-common": "npm:^0.0.12"
"@carto/create-common": "npm:^0.0.13-0"
"@deck.gl/aggregation-layers": "npm:^9.0.24"
"@deck.gl/carto": "npm:^9.0.24"
"@deck.gl/core": "npm:^9.0.24"
Expand Down Expand Up @@ -2517,7 +2517,7 @@ __metadata:
dependencies:
"@auth0/auth0-vue": "npm:^2.3.3"
"@carto/api-client": "npm:^0.1.0"
"@carto/create-common": "npm:^0.0.12"
"@carto/create-common": "npm:^0.0.13-0"
"@deck.gl/aggregation-layers": "npm:^9.0.24"
"@deck.gl/carto": "npm:^9.0.24"
"@deck.gl/core": "npm:^9.0.24"
Expand Down Expand Up @@ -15326,7 +15326,7 @@ __metadata:
meow: "npm:^13.2.0"
prettier: "npm:^3.3.3"
rimraf: "npm:^6.0.1"
typescript: "npm:^5.6.2"
typescript: "npm:5.5.4"
vite: "npm:^5.4.6"
languageName: unknown
linkType: soft
Expand Down

0 comments on commit 287788b

Please sign in to comment.