Skip to content

Commit 880898d

Browse files
authored
Finding GHP Rejects Un-Scoped NPM 📦 (#93) (#98)
After merging #94, we find that GitHub Packages \[GHP\], does not accept publishing of un-scoped packages. Instead of giving up on GHP entirely, let's publish this under two different names: 1. On NPM, as always, it's the `mapbox-gl-circle` package 2. On GHP, it's the same code as on NPM but published as the "`@smithmicro/mapbox-gl-circle`" package
1 parent 8091b9c commit 880898d

File tree

4 files changed

+39
-25
lines changed

4 files changed

+39
-25
lines changed

.github/workflows/publish-prerelease.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,32 @@ jobs:
3434
CHANGELOG_SECTION="### v. $(echo $BUILD_VERSION | cut -d- -f1)"
3535
echo "Ensure changelog has a '$CHANGELOG_SECTION' section ..." && grep -Fq "$CHANGELOG_SECTION" README.md
3636
37-
# Build package
37+
# Build API documentation
38+
npm run docs
39+
40+
# Build and publish to GHP
41+
npm pkg set name=@smithmicro/mapbox-gl-circle
42+
npm install
3843
rm -rf dist/
3944
npm run browserify
4045
npm run prepare
41-
npm run docs
42-
43-
# Publish to NPM
44-
echo 'registry=https://registry.npmjs.org' >> .npmrc
45-
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}' >> .npmrc
46+
echo 'registry=https://npm.pkg.github.com' >> .npmrc
47+
echo '//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}' >> .npmrc
4648
npm publish --tag=next --access=public
4749
git restore .npmrc
48-
echo "Pre-release $BUILD_VERSION published to NPM."
50+
echo "Pre-release @smithmicro/mapbox-gl-circle-$BUILD_VERSION published to GHP."
4951
50-
# Publish to GHP
51-
echo 'registry=https://npm.pkg.github.com' >> .npmrc
52-
echo '//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}' >> .npmrc
52+
# Build and publish to NPM
53+
npm pkg set name=mapbox-gl-circle
54+
npm install
55+
rm -rf dist/
56+
npm run browserify
57+
npm run prepare
58+
echo 'registry=https://registry.npmjs.org' >> .npmrc
59+
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}' >> .npmrc
5360
npm publish --tag=next --access=public
5461
git restore .npmrc
55-
echo "Pre-release $BUILD_VERSION published to GHP."
62+
echo "Pre-release mapbox-gl-circle-$BUILD_VERSION published to NPM."
5663
5764
git config --local user.email "[email protected]"
5865
git config --local user.name "GitHub Actions"

.github/workflows/publish-release.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,32 @@ jobs:
3030
CHANGELOG_SECTION="### v. $BUILD_VERSION"
3131
echo "Ensure changelog has a '$CHANGELOG_SECTION' section ..." && grep -Fq "$CHANGELOG_SECTION" README.md
3232
33-
# Build package
33+
# Build API documentation
34+
npm run docs
35+
36+
# Build and publish to GHP
37+
npm pkg set name=@smithmicro/mapbox-gl-circle
38+
npm install
3439
rm -rf dist/
3540
npm run browserify
3641
npm run prepare
37-
npm run docs
38-
39-
# Publish to NPM
40-
echo 'registry=https://registry.npmjs.org' >> .npmrc
41-
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}' >> .npmrc
42+
echo 'registry=https://npm.pkg.github.com' >> .npmrc
43+
echo '//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}' >> .npmrc
4244
npm publish --tag=latest --access=public
4345
git restore .npmrc
44-
echo "Release $BUILD_VERSION published to NPM."
46+
echo "Release @smithmicro/mapbox-gl-circle-$BUILD_VERSION published to GHP."
4547
46-
# Publish to GHP
47-
echo 'registry=https://npm.pkg.github.com' >> .npmrc
48-
echo '//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}' >> .npmrc
48+
# Build and publish to NPM
49+
npm pkg set name=mapbox-gl-circle
50+
npm install
51+
rm -rf dist/
52+
npm run browserify
53+
npm run prepare
54+
echo 'registry=https://registry.npmjs.org' >> .npmrc
55+
echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}' >> .npmrc
4956
npm publish --tag=latest --access=public
5057
git restore .npmrc
51-
echo "Release $BUILD_VERSION published to GHP."
58+
echo "Release mapbox-gl-circle-$BUILD_VERSION published to NPM."
5259
5360
git config --local user.email "[email protected]"
5461
git config --local user.name "GitHub Actions"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mapbox-gl-circle",
3-
"version": "1.6.5",
3+
"version": "1.6.6-0",
44
"author": "Smith Micro Software, Inc.",
55
"license": "ISC",
66
"description": "A google.maps.Circle replacement for Mapbox GL JS API",

0 commit comments

Comments
 (0)