Skip to content

Commit 3326323

Browse files
committed
fix: update workflow configuration for GitHub Packages and npm publishing
1 parent 8bb26aa commit 3326323

2 files changed

Lines changed: 10 additions & 63 deletions

File tree

.github/workflows/ci-semantic-release.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,20 @@ jobs:
1515
contents: write # Needed to create releases and tags
1616
issues: write # Needed to comment on issues
1717
pull-requests: write # Needed to comment on pull requests
18-
packages: write # Needed for GitHub Packages publishing
18+
# packages permission removed as we're not using GitHub Packages
1919
steps:
2020
# Step 1: Check out the full Git history for proper versioning
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0 # Fetches all history for all branches and tags
2525

26-
# Step 2: Setup Node.js environment with GitHub registry
27-
- name: Setup Node.js with GitHub registry
26+
# Step 2: Setup Node.js environment
27+
- name: Setup Node.js
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: 22 # Using Node.js 22
3131
cache: 'npm' # Enable npm caching
32-
registry-url: 'https://npm.pkg.github.com' # GitHub Packages registry
33-
scope: '@aashari'
3432

3533
# Step 3: Install dependencies with clean install
3634
- name: Install dependencies
@@ -50,47 +48,15 @@ jobs:
5048
git config --global user.email "actions@github.com"
5149
git config --global user.name "GitHub Actions"
5250
53-
# Step 7: Run semantic-release to analyze commits, version, and create GitHub release
51+
# Step 7: Run semantic-release to analyze commits and publish to npm
5452
- name: Semantic Release
5553
id: semantic
5654
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For GitHub operations
55+
# Tokens needed for GitHub and npm authentication
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For creating releases and commenting
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # For publishing to npm
5858
run: |
59-
echo "Running semantic-release for version bump and GitHub release"
59+
echo "Running semantic-release for version bump and npm publishing"
6060
npx semantic-release
6161
62-
# Step 8: Temporarily modify package.json for GitHub Packages and publish
63-
- name: Publish to GitHub Packages
64-
if: steps.semantic.outcome == 'success'
65-
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
run: |
68-
# Publish to GitHub Packages
69-
echo "Publishing to GitHub Packages"
70-
jq '.publishConfig.registry = "https://npm.pkg.github.com"' package.json > temp.json && mv temp.json package.json
71-
npm publish
72-
73-
# Restore original package.json for npm publishing
74-
git checkout -- package.json
75-
76-
echo "Successfully published to GitHub Packages"
77-
78-
# Step 9: Setup Node.js for npm registry (optional)
79-
- name: Setup Node.js for npm registry
80-
if: steps.semantic.outcome == 'success' && env.NPM_TOKEN != ''
81-
uses: actions/setup-node@v4
82-
with:
83-
node-version: 22
84-
registry-url: 'https://registry.npmjs.org/'
85-
scope: '@aashari'
86-
env:
87-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
88-
89-
# Step 10: Publish to npm (optional)
90-
- name: Publish to npm
91-
if: steps.semantic.outcome == 'success' && env.NPM_TOKEN != ''
92-
env:
93-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
94-
run: |
95-
echo "Publishing to npm registry (optional)"
96-
npm publish || echo "npm publishing failed, but GitHub Packages succeeded"
62+
# Note: GitHub Packages publishing has been removed

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Overview
1010

11-
A lightweight TypeScript/Node.js library for geocoding and reverse geocoding operations with multilingual support. This library provides a simple, dependency-free solution for converting between addresses and geographic coordinates. Available from both npm and GitHub Packages.
11+
A lightweight TypeScript/Node.js library for geocoding and reverse geocoding operations with multilingual support. This library provides a simple, dependency-free solution for converting between addresses and geographic coordinates.
1212

1313
> ⚠️ **Disclaimer**: This library is intended for non-commercial, low-volume applications. For production or commercial use, please use the official [Google Maps API](https://developers.google.com/maps/documentation/geocoding/overview).
1414
@@ -25,29 +25,10 @@ A lightweight TypeScript/Node.js library for geocoding and reverse geocoding ope
2525

2626
## Installation
2727

28-
### From npm (Recommended)
29-
30-
```bash
31-
npm install @aashari/nodejs-geocoding
32-
```
33-
34-
### From GitHub Packages
35-
36-
1. Create or update your `.npmrc` file:
37-
38-
```
39-
@aashari:registry=https://npm.pkg.github.com
40-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
41-
```
42-
43-
2. Install the package:
44-
4528
```bash
4629
npm install @aashari/nodejs-geocoding
4730
```
4831

49-
Replace `YOUR_GITHUB_TOKEN` with a GitHub Personal Access Token that has the `read:packages` scope.
50-
5132
## Quick Start
5233

5334
### Geocoding (Address to Coordinates)

0 commit comments

Comments
 (0)