forked from OasisDEX/oasis-borrow
-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (69 loc) · 2.59 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
68
69
70
71
72
73
74
75
76
77
# 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@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- 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 }}
# See: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Use Yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --prefer-offline --frozen-lockfile
- name: release version
run: npm run release -- ${{ 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