Skip to content

Commit

Permalink
add release package action
Browse files Browse the repository at this point in the history
  • Loading branch information
iamfrank committed Oct 18, 2022
1 parent c798446 commit 3d1f29c
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 28 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

# Important note:
# This only works in github actions when you've added an "automation token" by the name of "NPM_TOKEN" to "repository secrets"
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ You can use these as building blocks for your own web application that wants to

## Installation

1. Install from [Github](https://github.com/SDFIdk/saul) (latest):
1. Install iva NPM:
```
npm install --save git@github.com:SDFIdk/saul.git
npm i --save @dataforsyningen/saul
```

2. Create a configuration file or Javascript object with proper values and make sure to load it into your application before using any of the SAUL utilities. This package ships with an example configuration file at `/example/config.js.example`
Expand All @@ -18,7 +18,7 @@ npm install --save git@github.com:SDFIdk/saul.git
This is an example of how to import and use those utilities in Javascript:
```
import auth from './config.js' // This is the path to your configuration file
import {getSTAC} from 'skraafoto-saul'
import {getSTAC} from '@dataforsyningen/saul'
let response = await getSTAC('/some-stac-endpoint', auth)
console.log(response)
Expand All @@ -34,7 +34,7 @@ A `docs` directory will be created with a bunch of HTML files containing the doc

## How to test

From within `node_modules/saul` you can run the `test` command to check that saul core features are still working.
From within `node_modules/@dataforsyningen/saul` you can run the `test` command to check that saul core features are still working.
```
npm run test
```
Expand Down
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "skraafoto-saul",
"version": "2.1.0",
"name": "@dataforsyningen/saul",
"version": "3.0.0",
"description": "This is a collection of stand-alone methods for photogrammetry calculations and API interactions for 'Danske Skråfotos'.",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit 3d1f29c

Please sign in to comment.