-
Notifications
You must be signed in to change notification settings - Fork 69
67 lines (61 loc) · 2.19 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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@v4
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18.19.1
- 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 }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- 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