|
| 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 | +[][code-metric-url] [][code-metric-url] [][code-metric-url] [][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 |
0 commit comments