Skip to content

Commit

Permalink
Merge branch 'release/3.0.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
georgique committed Apr 12, 2023
2 parents 6414209 + 6a206f7 commit 50c2a6c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 13 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish NPM package

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install

- name: Build
run: npm run build

- name: Prep .npmrc for publishing
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
- name: Publish NPM package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: |
npm pkg set version="${{ env.RELEASE_VERSION }}"
npm publish
13 changes: 1 addition & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release on GitHub

on:
push:
Expand Down Expand Up @@ -40,17 +40,6 @@ jobs:
- name: Build
run: npm run build

- name: Prep .npmrc for publishing
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
- name: Publish NPM package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: npm publish

- uses: montudor/[email protected]
if: (!startsWith(github.ref, 'refs/heads/release') && !startsWith(github.ref, 'refs/heads/hotfix'))
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@

* New: adding integration with NPM
* Update: aligned borders for all the countries and improved quality for some of them

## v3.0.1

* Update: split GitHub release publication from NPM publishing
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "GeoJson for all the countries, areas (regions) and some states.",
"license": "GPL-3.0-or-later",
"repository": "git://github.com/georgique/world-geojson.git",
"version": "3.0.0",
"version": "3.0.1",
"files": [
"areas",
"countries",
Expand Down

0 comments on commit 50c2a6c

Please sign in to comment.