Skip to content

Commit

Permalink
✨ Adding build input variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Hand committed Apr 6, 2021
1 parent 0e77e48 commit d4ed7fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,16 @@ on:
- dev

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install deps and build
run: npm ci && npm run build
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/

release:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Tag new version
id: tag
uses: clevyr/release-it-tagger-action@logs
- name: Download build
uses: actions/download-artifact@v2
with:
name: dist
build: "npm ci && npm run build"
- name: Create a GitHub release
uses: actions/create-release@v1
env:
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'release-it tagger action'
description: 'Given a repo with a valid VERSION file, increment the version based on calver standards.'
inputs:
build:
description: 'Command to pass to build the project. Warning, this will commit the build to the repository!'
required: false
github-create-tag:
description: 'Used to create a release on github'
default: 'true'
Expand Down
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ function attachPlugins(pluginsArray) {
}
}

function attachHooks(hooksArray) {
if (core.getInput('build')) {
hooksArray['after:bump'] = core.getInput('build');
}
}

function preReleaseType() {
const githubRef = !isLocal() && github.context.ref;
const devBranch = sanitizeBranchInput(BRANCHES['dev']);
Expand Down Expand Up @@ -83,9 +89,11 @@ try {
'tag': writeVersionInfo() && sanitizeToggleInput(TOGGLES['github-create-tag']) || true,
'commit': writeVersionInfo(),
},
'plugins': {}
'hooks': {},
'plugins': {},
};
attachPlugins(options['plugins']);
attachHooks(options['hooks']);
releaseIt(options).then(data => {
core.setOutput('version', data.version);
}, error => {
Expand Down

0 comments on commit d4ed7fb

Please sign in to comment.