Skip to content

Commit

Permalink
Add set-version script
Browse files Browse the repository at this point in the history
ok

Stash before setting version

Update main.workflow

Use shell variable substitution toget the tag version

rename action to test & publish

Update main.workflow

Update main.workflow

Update main.workflow

revert to previous workflow
  • Loading branch information
chee committed Feb 20, 2019
1 parent 2c79587 commit 995f4d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/main.workflow
@@ -1,4 +1,4 @@
workflow "npm test" {
workflow "test & publish" {
on = "push"
resolves = [
"Publish",
Expand Down Expand Up @@ -27,6 +27,11 @@ action "Set version" {
uses = "actions/npm@59b64a598378f31e49cb76f27d6f3312b582f680"
needs = ["tag-only filter"]
args = "run set-version"
env = {
EMAIL = "chee-github-action@snoot.club"
GIT_AUTHOR_NAME = "github"
GIT_COMMITTER_NAME = "github"
}
}

action "Publish" {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"main": "esmboot.js",
"module": "index.js",
"scripts": {
"set-version":"node -e \"pkg = require('./package.json'); pkg.version = '$(echo $GITHUB_REF | grep -Eo '\\d+\\.\\d+\\.\\d+')'; fs.writeFile('package.json', JSON.stringify(pkg), Function.prototype)\"",
"set-version": "git stash && npm --no-git-tag-version version ${GITHUB_REF##refs/tags/v}",
"test": "mocha -r esm --recursive tests"
},
"bin": "esmboot.js",
Expand Down

0 comments on commit 995f4d0

Please sign in to comment.