@zcong/actions-installer
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

actions-installer

NPM version NPM downloads CircleCI codecov

Easily build a setup actions

Install

$ yarn add @zcong/actions-installer

Usage

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

Readme

Keywords

none

Package Sidebar

Install

npm i @zcong/actions-installer

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

11.7 kB

Total Files

7

Last publish

Collaborators

  • zcong