From 8103c061c3feb945f3815774980c12fb3cf3076e Mon Sep 17 00:00:00 2001 From: Mikeal Rogers Date: Sat, 26 Jan 2019 22:03:51 +0000 Subject: [PATCH] feat: cli and release workflow --- .github/main.workflow | 38 ++++++++++++++++++++++++++++++++++++++ cli.js | 1 + package.json | 26 ++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .github/main.workflow create mode 100644 cli.js create mode 100644 package.json diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 0000000..1ce0076 --- /dev/null +++ b/.github/main.workflow @@ -0,0 +1,38 @@ +workflow "Build and Publish" { + on = "push" + resolves = "Docker Publish" +} + +action "Shell Lint" { + uses = "actions/bin/shellcheck@master" + args = "entrypoint.sh" +} + +action "Docker Lint" { + uses = "docker://replicated/dockerfilelint" + args = ["Dockerfile"] +} + +action "Build" { + needs = ["Shell Lint", "Docker Lint"] + uses = "actions/docker/cli@master" + args = "build -t npm ." +} + +action "Docker Tag" { + needs = ["Build"] + uses = "actions/docker/tag@master" + args = "npm github/npm --no-latest" +} + +action "Publish Filter" { + needs = ["Build"] + uses = "actions/bin/filter@master" + args = "branch master" +} + +action "NPM Publish" { + needs = "Publish Filter" { + uses = "mikeal/auto-release@master" + secrets = ["NPM_AUTH_TOKEN"] +} diff --git a/cli.js b/cli.js new file mode 100644 index 0000000..b0bf05e --- /dev/null +++ b/cli.js @@ -0,0 +1 @@ +console.log(process.env) diff --git a/package.json b/package.json new file mode 100644 index 0000000..543e715 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "auto-release", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "bin": { + "auto-release": "./cli.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mikeal/auto-release.git" + }, + "keywords": [], + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/mikeal/auto-release/issues" + }, + "homepage": "https://github.com/mikeal/auto-release#readme", + "dependencies": { + "yargs": "^12.0.5" + } +}