Skip to content

Commit

Permalink
Merge pull request #15 from iambumblehead/add-github-deployment
Browse files Browse the repository at this point in the history
use mjs files, add .github dir and files
  • Loading branch information
iambumblehead authored May 14, 2021
2 parents 0adda5d + 81c59ae commit 8e4e0ab
Show file tree
Hide file tree
Showing 10 changed files with 4,112 additions and 371 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"env": {
"browser": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "script",
"allowImportExportEverywhere": true
"ecmaVersion": 2015
},
"globals": {
"jasmine": false,
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: nodejs-lint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: lint
uses: actions/setup-node@v2
with:
node-version: '15.x'
- run: npm ci
- run: npm run lint
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: nodejs-ci

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
60 changes: 60 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

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

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 15
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 15
registry-url: https://npm.pkg.github.com/
- name: Insert repository owner as scope into package name
run: |
node <<EOF
const fs = require('fs').promises;
fs.readFile('package.json', 'utf8').then((data) => JSON.parse(data)).then((json) => {
json.name = '@$(echo "$GITHUB_REPOSITORY" | sed 's/\/.\+//')/' + json.name;
console.info('Package name changed to %s', json.name);
return fs.writeFile('package.json', JSON.stringify(json), 'utf8');
}).catch(error => {
console.error(error);
process.exit(1);
});
EOF
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ form-urldecoded
===============
**(c)[Frabarz][1], [Bumblehead][0]** [MIT-license](#license)

[![npm version](https://badge.fury.io/js/form-urldecoded.svg)](https://badge.fury.io/js/form-urldecoded) [![Build Status](https://travis-ci.org/iambumblehead/form-urldecoded.svg?branch=master)](https://travis-ci.org/iambumblehead/form-urldecoded)
[![npm version](https://badge.fury.io/js/form-urldecoded.svg)](https://badge.fury.io/js/form-urldecoded) [![Build Status](https://github.com/iambumblehead/form-urldecoded/workflows/nodejs-ci/badge.svg)][2]


Returns an object from a [query string.][2]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions form-urldecoded.spec.js → form-urldecoded.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Timestamp: 2016.04.28-13:20:22 (last modified)
// Author(s): bumblehead <[email protected]>

const test = require('ava');
const formurldecoded = require('.');
import test from 'ava';
import formurldecoded from './form-urldecoded.js';

test("should decode a query string", t => {
t.deepEqual(formurldecoded('www.myurl.com?param1=1&param2=two'), {
Expand Down
Loading

0 comments on commit 8e4e0ab

Please sign in to comment.