diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab6b44c..ffbf9d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/action.yml b/action.yml index e48eb20..b7be0b8 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/src/index.js b/src/index.js index 9b04947..21834e1 100644 --- a/src/index.js +++ b/src/index.js @@ -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']); @@ -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 => {