Skip to content

Commit

Permalink
ci: add workflow for build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit committed Jul 9, 2021
1 parent 00e6fb4 commit 4d627ec
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Run lint and test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
- run: npm install
- run: npm run lint
- run: npm test
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release NPM Package

on:
push:
tags: '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
scope: '@jawg'
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_ACCESS_TOKEN }}
- name: Install kokai
run: cargo install kokai
- name: Create Release Note
run: kokai release --ref ${{ github.ref }} --tag-from-ref . > RELEASE_NOTE.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: RELEASE_NOTE.md
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { JawgPlaces } from './src/places-js';
import JawgPlaces from './src/places-js';

export { JawgPlaces };
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@jawg/types",
"version": "0.0.0",
"version": "1.0.0",
"description": "Shared TypeScript definitions for Jawg Maps projects",
"types": "./index.d.ts",
"typeScriptVersion": "2.3",
"scripts": {
"docs": "typedoc --out docs src/ && touch docs/.nojekyll",
"docs": "typedoc --out docs index.d.ts && touch docs/.nojekyll",
"lint": "dtslint",
"start": "rollup -c -w",
"test": "tsc --noEmit test/*.ts"
Expand Down
3 changes: 2 additions & 1 deletion src/places-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,5 @@ declare namespace JawgPlaces {
function attributions(): HTMLElement;
}

export { JawgPlaces };
export as namespace JawgPlaces;
export default JawgPlaces;
9 changes: 9 additions & 0 deletions test/places-js.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Map as MapboxGLMap } from 'mapbox-gl';
import { Map as MapLibreGLMap } from 'maplibre-gl';
import { JawgPlaces } from '../';


new JawgPlaces.Input({input: '', accessToken: '<Access-Token>'})
new JawgPlaces.MapLibre({input: '', accessToken: '<Access-Token>'})
new JawgPlaces.Mapbox({input: '', accessToken: '<Access-Token>'}).attachMap(new MapboxGLMap())
new JawgPlaces.Leaflet({input: '', accessToken: '<Access-Token>', L: {}})

0 comments on commit 4d627ec

Please sign in to comment.