Skip to content

Commit

Permalink
Merge pull request #13 from chaseadamsio/ci-addReleaseIt
Browse files Browse the repository at this point in the history
Add Release It & VSCE automation
  • Loading branch information
chaseadamsio authored May 19, 2019
2 parents 83cca3e + 7196ab9 commit b7942cd
Show file tree
Hide file tree
Showing 9 changed files with 1,821 additions and 41 deletions.
12 changes: 12 additions & 0 deletions .github/actions/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:11.11.0-alpine

LABEL "com.github.actions.name"="Release"
LABEL "com.github.actions.description"="Release the extension"
LABEL "com.github.actions.icon"="check-circle"
LABEL "com.github.actions.color"="green"

RUN apk add --update --no-cache bash git openssh openssh-client

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
10 changes: 10 additions & 0 deletions .github/actions/release/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
git config --global user.email "[email protected]"
git config --global user.name "CAIO VSCE Robot"

git branch -u origin/master

yarn install
yarn run release
25 changes: 25 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@ workflow "Pull Request" {
resolves = ["Check Code"]
}

workflow "Build, Test & Publish" {
on = "push"
resolves = ["Release"]
}

action "Check Code" {
uses ="./.github/actions/check"
}

action "Tag" {
needs = "Check Code"
uses = "actions/bin/filter@master"
args = "tag v*"
}

action "Release" {
needs = "Tag"
uses = "./.github/actions/release"
secrets = ["GITHUB_TOKEN", "SSH_PRIVATE_KEY"]
}

# action "Publish" {
# needs = "Tag"
# uses = "lannonbr/vsce-action@master"
# args = "publish -p $VSCE_TOKEN"
# secrets = ["GITHUB_TOKEN"]
# secrets = ["VSCE_TOKEN"]
# }
17 changes: 17 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
// npm: false (commenting out but leaving, )
github: {
release: false,
releaseNotes: false
},
git: {
changelog:
"npx auto-changelog --stdout --commit-limit false -u --template ./release-it/changelog.hbs"
},
scripts: {
beforeStage: "npx auto-changelog -p"
},
plugins: {
"./release-it/version.js": {}
}
};
9 changes: 0 additions & 9 deletions CHANGELOG.md

This file was deleted.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@
"type": "git",
"url": "https://github.com/chaseadamsio/vscode-theme-neon-night"
},
"version": "0.0.1",
"private": true,
"version": "0.1.2",
"scripts": {
"build": "node src/index.js",
"clean": "rm -rf themes",
"cp:static": "cp README.md themes && cp LICENSE themes && cp -R static themes",
"develop:init": "(test -L $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night || ln -s $PWD/themes $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night) && yarn build",
"release": "release-it --ci",
"test:check-code": "yarn test:lint && yarn test:flow",
"test:flow": "flow check",
"test:lint": "eslint --ignore-path .gitignore --ext .js,.jsx .",
"vscode:prepublish": "(test -d themes || mkdir themes) && yarn build && yarn cp:static",
"vscode:publish": "cd themes && vsce"
},
"dependencies": {
"auto-changelog": "^1.13.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-flowtype": "^3.9.0",
"flow-bin": "^0.98.1",
"prettier": "^1.17.1"
"prettier": "^1.17.1",
"release-it": "^12.2.0"
}
}
19 changes: 19 additions & 0 deletions release-it/changelog.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Changelog

All notable changes to "Neon Night" will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

{{#each releases}}
{{#if @first}}
{{#each merges}}
- {{{message}}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}
{{/each}}
{{#each fixes}}
- {{{commit.subject}}}{{#each fixes}}{{#if href}} [`#{{id}}`]({{href}}){{/if}}{{/each}}
{{/each}}
{{#each commits}}
- {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}}
{{/each}}
{{/if}}
{{/each}}
10 changes: 10 additions & 0 deletions release-it/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const pkgJSON = require(`../package.json`);
const { Plugin } = require(`release-it`);

class MyPlugin extends Plugin {
getLatestVersion() {
return pkgJSON.version.trim();
}
}

module.exports = MyPlugin;
Loading

0 comments on commit b7942cd

Please sign in to comment.