Skip to content

Release CI

Release CI #24

Workflow file for this run

name: Release CI
on:
workflow_dispatch:
inputs:
version-to-bump:
type: choice
required: true
description: 'Select which part of the version to bump and release'
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Set up NodeJs
uses: actions/[email protected]
with:
node-version: '20'
cache: 'npm'
- name: Bump version and tag via NodeJS
run: |-
git config user.name "dependencytrack-bot"
git config user.email "[email protected]"
npm version ${{ github.event.inputs.version-to-bump }} -m "prepare-release: set version to %s"
git push origin "HEAD:${{ github.ref }}"
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.BOT_RELEASE_TOKEN }}
GH_OPTS: ''
run: |-
VERSION=`jq -r '.version' package.json`
if [[ "${{ contains(github.event.inputs.version-to-bump, 'pre') }}" == "true" ]]; then
GH_OPTS="--prerelease"
fi
gh release create "${VERSION}" ${GH_OPTS} \
--target "${{ github.ref_name }}" \
--title "${VERSION}" \
--generate-notes