0.4.0 • Published 2 years ago

@zcong/actions-installer v0.4.0

Weekly downloads
1
License
MIT
Repository
-
Last release
2 years ago

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

0.4.0

2 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.0

3 years ago

0.1.1

5 years ago

0.1.0

5 years ago