Skip to content

Commit 996266a

Browse files
authored
Merge pull request #4 from gregoranders/development
Closes #3
2 parents 0ed7733 + 05544cf commit 996266a

File tree

14 files changed

+902
-0
lines changed

14 files changed

+902
-0
lines changed

.editorconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 2
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
[*.ts]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.json]
27+
indent_style = space
28+
indent_size = 2
29+
30+
[*.yml]
31+
indent_style = space
32+
indent_size = 2

.github/workflows/development.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Development CI
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
node-version: [12.x, 13.x]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: nodejs project info
25+
id: projectinfo
26+
uses: gregoranders/nodejs-project-info@v0.0.3
27+
env:
28+
CI: true
29+
- name: npm install
30+
run: |
31+
npm install
32+
env:
33+
CI: true
34+
- name: npm run build
35+
run: |
36+
npm run build
37+
env:
38+
CI: true
39+
- name: npm test
40+
run: |
41+
npm test
42+
env:
43+
CI: true
44+
- name: code coverage
45+
uses: coverallsapp/github-action@master
46+
with:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
48+
path-to-lcov: ./coverage/lcov.info
49+
env:
50+
CI: true
51+
- name: publish code coverage to code climate
52+
if: matrix.os == 'ubuntu-latest'
53+
uses: paambaati/codeclimate-action@v2.3.0
54+
env:
55+
CI: true
56+
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE }}
57+
with:
58+
coverageCommand: npm run test
59+
debug: true

.github/workflows/master.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Master CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
node-version: [12.x, 13.x]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- name: nodejs project info
25+
id: projectinfo
26+
uses: gregoranders/nodejs-project-info@v0.0.3
27+
env:
28+
CI: true
29+
- name: npm install
30+
run: |
31+
npm install
32+
env:
33+
CI: true
34+
- name: npm run build
35+
run: |
36+
npm run build
37+
env:
38+
CI: true
39+
- name: npm test
40+
run: |
41+
npm test
42+
env:
43+
CI: true
44+
- name: code coverage
45+
uses: coverallsapp/github-action@master
46+
with:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}
48+
path-to-lcov: ./coverage/lcov.info
49+
env:
50+
CI: true
51+
- name: publish code coverage to code climate
52+
if: matrix.os == 'ubuntu-latest'
53+
uses: paambaati/codeclimate-action@v2.3.0
54+
env:
55+
CI: true
56+
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE }}
57+
with:
58+
coverageCommand: npm run test
59+
debug: true
60+
- name: create release
61+
id: createrelease
62+
uses: gregoranders/nodejs-create-release@v0.0.3
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
tag: v${{ steps.projectinfo.outputs.version }}
67+
name: ${{ steps.projectinfo.outputs.name }} - ${{ steps.projectinfo.outputs.version }}
68+
body: ${{ steps.projectinfo.outputs.name }} - ${{ steps.projectinfo.outputs.version }} Release
69+
draft: false
70+
target: ${{ github.ref }}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Gregor Anders
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# NodeJS Upload Asset
2+
3+
## [GitHub Action](https://github.com/features/actions) written in [TypeScript](http://www.typescriptlang.org/)
4+
5+
### Upload asset to release - [GitHub Action](https://github.com/features/actions).
6+
7+
This action uploads an asset to a release, so your workflow can access it.
8+
9+
[![Dependency Status][daviddm-image]][daviddm-url]
10+
[![License][license-image]][license-url]
11+
[![Issues][issues-image]][issues-url]
12+
13+
14+
[![Master Build][master-build-image]][master-url] [![Master Coverage][master-coveralls-image]][master-coveralls-url] [![Master Version][master-version-image]][master-version-url]
15+
16+
[![Development Build][development-build-image]][development-url] [![Development Coverage][development-coveralls-image]][development-coveralls-url] [![Development Version][development-version-image]][development-version-url]
17+
18+
[![Code maintainability][code-maintainability-image]][code-maintainability-url] [![Code issues][code-issues-image]][code-issues-url] [![Code Technical Debt][code-tech-debt-image]][code-tech-debt-url]
19+
20+
[![Main Language](https://img.shields.io/github/languages/top/gregoranders/nodejs-upload-asset)][code-metric-url] [![Languages](https://img.shields.io/github/languages/count/gregoranders/nodejs-upload-asset)][code-metric-url] [![Code Size](https://img.shields.io/github/languages/code-size/gregoranders/nodejs-upload-asset)][code-metric-url] [![Repo-Size](https://img.shields.io/github/repo-size/gregoranders/nodejs-upload-asset)][code-metric-url]
21+
22+
## Usage
23+
```YML
24+
...
25+
- name: nodejs project information
26+
id: projectinfo
27+
uses: gregoranders/nodejs-project-info@v0.0.3
28+
- name: create release
29+
id: createrelease
30+
uses: gregoranders/nodejs-create-release@v0.0.3
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
with:
34+
tag: v${{ steps.projectinfo.outputs.version }}
35+
name: ${{ steps.projectinfo.outputs.name }} - ${{ steps.projectinfo.outputs.version }} Release
36+
target: ${{ github.ref }}
37+
- name: upload asset
38+
id: uploadasset
39+
uses: gregoranders/nodejs-upload-asset@v0.0.1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
url: ${{ steps.createrelease.outputs.upload_url }}
44+
path: package.json
45+
name: '${{ steps.projectinfo.outputs.name }} - ${{ steps.projectinfo.outputs.version }}'
46+
...
47+
```
48+
49+
#### Inputs/Outputs
50+
```YML
51+
inputs:
52+
url:
53+
description: 'Release Asset Upload Url'
54+
required: true
55+
path:
56+
description: 'Release Asset Path'
57+
required: true
58+
label:
59+
description: 'Release Asset Label'
60+
required: false
61+
default: '${name}'
62+
name:
63+
description: 'Release Asset File Name'
64+
required: false
65+
default: '${path}'
66+
outputs:
67+
id:
68+
description: 'Release Id'
69+
url:
70+
description: 'Release Url'
71+
```
72+
73+
## Development
74+
75+
### Clone repository
76+
```SH
77+
git clone https://github.com/gregoranders/nodejs-upload-asset
78+
```
79+
80+
### Install dependencies
81+
```SH
82+
npm install
83+
```
84+
85+
### Build
86+
87+
```SH
88+
npm run build
89+
```
90+
91+
### Testing
92+
93+
#### Test using [Jest](https://jestjs.io/)
94+
```SH
95+
npm test
96+
```
97+
98+
### Run
99+
```SH
100+
npm start
101+
```
102+
103+
### Clear
104+
```SH
105+
npm run clear
106+
```
107+
108+
[release-url]: https://github.com/gregoranders/nodejs-upload-asset/releases
109+
[master-url]: https://github.com/gregoranders/nodejs-upload-asset/tree/master
110+
[development-url]: https://github.com/gregoranders/nodejs-upload-asset/tree/development
111+
[repository-url]: https://github.com/gregoranders/nodejs-upload-asset
112+
[code-metric-url]: https://github.com/gregoranders/nodejs-upload-asset/search?l=TypeScript
113+
114+
[travis-url]: https://travis-ci.org/gregoranders/nodejs-upload-asset
115+
[travis-image]: https://travis-ci.org/gregoranders/nodejs-upload-asset.svg?branch=master
116+
117+
[daviddm-url]: https://david-dm.org/gregoranders/nodejs-upload-asset
118+
[daviddm-image]: https://david-dm.org/gregoranders/nodejs-upload-asset.svg?branch=master
119+
120+
[license-url]: https://github.com/gregoranders/nodejs-upload-asset/blob/master/LICENSE
121+
[license-image]: https://img.shields.io/github/license/gregoranders/nodejs-upload-asset.svg
122+
123+
[master-version-url]: https://github.com/gregoranders/nodejs-upload-asset/blob/master/package.json
124+
[master-version-image]: https://img.shields.io/github/package-json/v/gregoranders/nodejs-upload-asset/master
125+
126+
[development-version-url]: https://github.com/gregoranders/nodejs-upload-asset/blob/development/package.json
127+
[development-version-image]: https://img.shields.io/github/package-json/v/gregoranders/nodejs-upload-asset/development
128+
129+
[issues-url]: https://github.com/gregoranders/nodejs-upload-asset/issues
130+
[issues-image]: https://img.shields.io/github/issues-raw/gregoranders/nodejs-upload-asset.svg
131+
132+
[master-build-image]: https://github.com/gregoranders/nodejs-upload-asset/workflows/Master%20CI/badge.svg
133+
[development-build-image]: https://github.com/gregoranders/nodejs-upload-asset/workflows/Development%20CI/badge.svg
134+
135+
[master-coveralls-url]: https://coveralls.io/github/gregoranders/nodejs-upload-asset?branch=master
136+
[master-coveralls-image]: https://img.shields.io/coveralls/github/gregoranders/nodejs-upload-asset/master
137+
[development-coveralls-image]: https://img.shields.io/coveralls/github/gregoranders/nodejs-upload-asset/development
138+
[development-coveralls-url]: https://coveralls.io/github/gregoranders/nodejs-upload-asset?branch=development
139+
140+
[code-maintainability-url]: https://codeclimate.com/github/gregoranders/nodejs-upload-asset/maintainability
141+
[code-maintainability-image]: https://img.shields.io/codeclimate/maintainability/gregoranders/nodejs-upload-asset
142+
143+
[code-issues-url]: https://codeclimate.com/github/gregoranders/nodejs-upload-asset/maintainability
144+
[code-issues-image]: https://img.shields.io/codeclimate/issues/gregoranders/nodejs-upload-asset
145+
146+
[code-tech-debt-url]: https://codeclimate.com/github/gregoranders/nodejs-upload-asset/maintainability
147+
[code-tech-debt-image]: https://img.shields.io/codeclimate/tech-debt/gregoranders/nodejs-upload-asset

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-minimal

action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'NodeJS Upload Asset'
2+
description: 'Upload asset'
3+
author: 'Gregor Anders <gregor.ander@gmail.com>'
4+
inputs:
5+
url:
6+
description: 'Release Asset Upload Url'
7+
required: true
8+
path:
9+
description: 'Release Asset Path'
10+
required: true
11+
label:
12+
description: 'Release Asset Label'
13+
required: false
14+
name:
15+
description: 'Release Asset File Name'
16+
required: false
17+
outputs:
18+
id:
19+
description: 'Asset Id'
20+
url:
21+
description: 'Asset Download Url'
22+
runs:
23+
using: 'node12'
24+
main: 'dist/index.js'
25+
branding:
26+
icon: 'package'
27+
color: 'red'

0 commit comments

Comments
 (0)