2021-03-28 09:07:49 +00:00
|
|
|
name: release_dev_to_master
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
increment:
|
|
|
|
description: "Increment Type (major, minor, patch)"
|
|
|
|
required: true
|
|
|
|
default: "patch"
|
2021-02-26 15:57:47 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
Release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
2021-03-28 09:07:49 +00:00
|
|
|
UI_DIRECTORY: ./frontend
|
|
|
|
ASSET_DIRECTORY: ./__builds__
|
2021-02-26 15:57:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Validate branch
|
|
|
|
if: ${{ github.ref != 'refs/heads/development' }}
|
|
|
|
run: |
|
|
|
|
echo This action can only be run on development branch, not ${{ github.ref }}
|
|
|
|
exit 1
|
2021-03-25 14:22:43 +00:00
|
|
|
|
2021-04-19 04:52:03 +00:00
|
|
|
- name: Checkout
|
2023-11-18 17:10:19 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-02-26 15:57:47 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: development
|
|
|
|
|
2021-03-28 09:07:49 +00:00
|
|
|
- name: Setup Git
|
|
|
|
run: git config --global user.name "github-actions"
|
2022-03-16 06:26:15 +00:00
|
|
|
|
2021-04-19 04:52:03 +00:00
|
|
|
- name: Cache node_modules
|
2024-03-12 00:09:49 +00:00
|
|
|
uses: actions/cache@v4
|
2021-04-19 04:52:03 +00:00
|
|
|
with:
|
2022-03-16 06:26:15 +00:00
|
|
|
path: "${{ env.UI_DIRECTORY }}/node_modules"
|
2021-04-19 04:52:03 +00:00
|
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-modules-
|
2021-03-28 09:07:49 +00:00
|
|
|
|
2021-02-26 15:57:47 +00:00
|
|
|
- name: Setup NodeJS
|
2024-03-26 01:15:27 +00:00
|
|
|
uses: actions/setup-node@v4
|
2021-02-26 15:57:47 +00:00
|
|
|
with:
|
2024-06-10 01:24:02 +00:00
|
|
|
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
|
2021-03-25 14:22:43 +00:00
|
|
|
|
2021-03-28 09:07:49 +00:00
|
|
|
- name: Install Global Tools
|
2021-05-08 16:06:52 +00:00
|
|
|
run: npm install -g release-it auto-changelog
|
2021-02-26 15:57:47 +00:00
|
|
|
|
2021-04-19 04:52:03 +00:00
|
|
|
- name: Install UI Dependencies
|
|
|
|
run: npm install
|
|
|
|
working-directory: ${{ env.UI_DIRECTORY }}
|
|
|
|
|
2021-05-08 16:06:52 +00:00
|
|
|
- name: Build UI
|
|
|
|
run: npm run build
|
2021-04-19 04:52:03 +00:00
|
|
|
working-directory: ${{ env.UI_DIRECTORY }}
|
2021-03-25 14:22:43 +00:00
|
|
|
|
2021-03-28 09:07:49 +00:00
|
|
|
- name: Create Release
|
2021-04-19 05:38:50 +00:00
|
|
|
run: |
|
2023-07-23 14:21:31 +00:00
|
|
|
git config user.name "${{github.actor}}"
|
|
|
|
git config user.email "${{github.actor}}@users.noreply.github.com"
|
2021-04-19 05:38:50 +00:00
|
|
|
export RELEASE_MASTER=1
|
|
|
|
release-it --ci --increment ${{ github.event.inputs.increment }}
|
2021-02-26 15:57:47 +00:00
|
|
|
Merge:
|
|
|
|
needs: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-28 09:07:49 +00:00
|
|
|
- name: Checkout
|
2023-11-18 17:10:19 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-02-26 15:57:47 +00:00
|
|
|
|
|
|
|
- name: Merge development -> master
|
2021-08-31 17:51:52 +00:00
|
|
|
uses: devmasx/merge-branch@1.4.0
|
2021-02-26 15:57:47 +00:00
|
|
|
with:
|
|
|
|
type: now
|
|
|
|
from_branch: development
|
|
|
|
target_branch: master
|
2021-03-25 14:22:43 +00:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|