Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zcong1993/actions-installer
Easily build a setup actions
https://github.com/zcong1993/actions-installer
Last synced: about 23 hours ago
JSON representation
Easily build a setup actions
- Host: GitHub
- URL: https://github.com/zcong1993/actions-installer
- Owner: zcong1993
- License: mit
- Created: 2019-08-18T17:17:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-04T00:34:58.000Z (6 months ago)
- Last Synced: 2024-05-04T01:31:45.084Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 379 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# actions-installer
[![NPM version](https://img.shields.io/npm/v/@zcong/actions-installer.svg?style=flat)](https://npmjs.com/package/@zcong/actions-installer) [![NPM downloads](https://img.shields.io/npm/dm/@zcong/actions-installer.svg?style=flat)](https://npmjs.com/package/@zcong/actions-installer) [![CircleCI](https://circleci.com/gh/zcong1993/actions-installer/tree/master.svg?style=shield)](https://circleci.com/gh/zcong1993/actions-installer/tree/master) [![codecov](https://codecov.io/gh/zcong1993/actions-installer/branch/master/graph/badge.svg)](https://codecov.io/gh/zcong1993/actions-installer)
> Easily build a setup actions
## Install
```sh
$ yarn add @zcong/actions-installer
```## Usage
```ts
import { Installer } from '@zcong/actions-installer'
import * as core from '@actions/core'class DockerizeInstaller extends Installer {
constructor() {
super('dockerize')
}setupDir() {
if (process.platform === 'win32') {
core.setFailed('not support windows platform')
}
super.setupDir()
}getDownloadUrlByVersion(version: string): string {
const platform: string = this.osPlat
const arch: string = this.osArch == 'x64' ? 'amd64' : '386'
const filename: string = `dockerize-${platform}-${arch}-v${version}.tar.gz`
return `https://github.com/jwilder/dockerize/releases/download/v${version}/${filename}`
}
}const instance = new DockerizeInstaller()
async function run() {
try {
const version = core.getInput('dockerize-version')
if (version) {
await instance.getTools(version)
}
} catch (error) {
core.setFailed(error.message)
}
}run()
```## License
MIT © zcong1993