Release the Kraken! π #322
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow that is manually triggered | |
name: Release the Kraken! π | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
release_type: | |
# Release type | |
description: 'Release type, major | minor | patch' | |
default: 'minor' | |
required: true | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "greet" | |
release: | |
runs-on: ubuntu-latest | |
# The type of runner that the job will run on | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Runs a single command using the runners shell | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.12 | |
- name: 'Determine Release Type' | |
run: | | |
if ${{ contains(github.event.inputs.release_type, 'major') }}; then | |
echo "RELEASE_TYPE=major" >> $GITHUB_ENV | |
elif ${{ contains(github.event.inputs.release_type, 'minor') }}; then | |
echo "RELEASE_TYPE=minor" >> $GITHUB_ENV | |
elif ${{ contains(github.event.inputs.release_type, 'patch') }}; then | |
echo "RELEASE_TYPE=patch" >> $GITHUB_ENV | |
else | |
echo "NOTE: There was no release type specified in the commit message, and therefore no release will be published." | |
exit 1 | |
fi | |
- name: 'Release Type' | |
run: echo ${{ env.RELEASE_TYPE }} | |
- name: git config | |
run: | | |
git config user.name ${{ github.actor }} | |
- name: release version | |
run: npx release-it -- ${{ env.RELEASE_TYPE }} --ci | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Merge dev -> main | |
run: | | |
git status | |
git pull | |
git fetch | |
git checkout main | |
git rebase dev | |
git push origin main | |
git status |