Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Action for publishing new releases #59

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// eslint-disable-next-line no-undef
module.exports = {
root: true,
extends: ["eslint:recommended"],
plugins: ["@typescript-eslint"],
rules: {
"no-console": "error",
"no-debugger": "error",
"indent": ["error", 4],
"max-len": ["warn", { "code": 120 }],
"object-curly-spacing": ["error", "always"],
"quotes": ["error", "double"],
"space-before-function-paren": ["error", "never"],
"no-inner-declarations": "off",
"brace-style": ["error", "1tbs"],
"keyword-spacing": "error",
"no-async-promise-executor": "off",
"require-atomic-updates": "off",
"no-unused-vars": "off"
},
parser: "@typescript-eslint/parser",
parserOptions: {
"ecmaVersion": 6,
"sourceType": "module",
},
env: {
"browser": true,
"node": true,
"jest": true
}
}
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Install ESLint CLI
run: npm i -g eslint
- name: Run ESLint
run: eslint "src/**/*.ts"

66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish

on:
workflow_dispatch:
inputs:
versionNumber:
description: 'Version number'
required: true

jobs:
release_npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Install dependencies
run: npm install
- name: Get latest commit SHA
id: commit_sha
shell: bash
run: |
echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Get package version number
id: package_version
shell: bash
run: |
echo "::set-output name=package_version::$(cat package.json | grep 'version' | sed 's/^.*\([0-9]\+.[0-9]\+.[0-9]\+\).*$/\1/')"
- name: Update package version number
run: sed -i 's/"version":."${{ steps.package.version.outputs.package_version }}"/"version":."${{ github.event.inputs.versionNumber }}"/' package.json
- name: Build library
run: npm run build && npm run types
- name: Commit the new package (and version number)
uses: EndBug/[email protected]
with:
author_name: Pieter Verschaffelt
author_email: [email protected]
message: Bump version number to ${{steps.package_version.outputs.package_version}}
push: true
- name: Create new tag
uses: octokit/[email protected]
id: create_new_tag
with:
route: POST /repos/:owner/:repo/git/tags
owner: unipept
repo: unipept-visualizations
tag: ${{ steps.package_version.outputs.package_version }}
message: "Release for version ${{ steps.package_version.outputs.package_version }}"
object: ${{ steps.commit_sha.outputs.sha }}
type: commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: true
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.package_version.outputs.package_version }}
release_name: ${{ steps.package_version.outputs.package_version }}
draft: false
prerelease: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/*
.DS_Store
dist/*
23 changes: 0 additions & 23 deletions dist/DataNode.d.ts

This file was deleted.

14 changes: 0 additions & 14 deletions dist/Settings.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions dist/color/ColorPalette.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions dist/color/ColorUtils.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions dist/color/index.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions dist/index.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions dist/render/CanvasRenderHelper.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions dist/render/RenderHelper.d.ts

This file was deleted.

29 changes: 0 additions & 29 deletions dist/transition/Transition.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dist/transition/index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dist/unipept-visualizations.js

This file was deleted.

12 changes: 0 additions & 12 deletions dist/utilities/NodeUtils.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions dist/utilities/StringUtils.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions dist/utilities/TooltipUtilities.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dist/utilities/index.d.ts

This file was deleted.

Loading