-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
68 lines (68 loc) · 2.41 KB
/
action.yml
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
name: Release action (node.js)
description: Releases a node.js action.
inputs:
token:
description: 'A Github PAT'
required: true
dry_run:
description: 'True to not commit anything'
required: false
default: "false"
use_yarn:
description: 'If true, uses yarn instead of npm'
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Read action node version
id: action-node-version
shell: bash
run: |
"$GITHUB_ACTION_PATH/node-version.sh"
- name: Set Node.js version for the action being released
uses: actions/setup-node@v3
with:
node-version: ${{ steps.action-node-version.outputs.node-version }}
- name: Get base branch
id: get_base_branch
uses: "smartlyio/github-actions@get-base-branch-v1"
with:
token: "${{ inputs.token }}"
- name: Get next semantic version
id: version_check
uses: "smartlyio/github-actions@get-next-semantic-version-v1"
with:
token: "${{ inputs.token }}"
git_default_branch: "${{ steps.get_base_branch.outputs.git_base_branch }}"
- name: Check branch behind
id: check_branch_behind
uses: "smartlyio/github-actions@check-branch-behind-v1"
with:
is_base_ref: ${{ inputs.dry_run == 'false' }}
remote_update: true
git_default_branch: "${{ steps.get_base_branch.outputs.git_base_branch }}"
- name: Create release
if: steps.check_branch_behind.outputs.branch_up_to_date == 'true' && steps.version_check.outputs.continue_release == 'true'
shell: bash
env:
USE_YARN: ${{ inputs.use_yarn }}
VERSION: ${{ steps.version_check.outputs.version }}
DRY_RUN: ${{ inputs.dry_run }}
run: |
"$GITHUB_ACTION_PATH/create-release.sh"
- name: Update action without release
if: steps.check_branch_behind.outputs.branch_up_to_date == 'true' && steps.version_check.outputs.continue_release == 'false'
shell: bash
env:
USE_YARN: ${{ inputs.use_yarn }}
DRY_RUN: ${{ inputs.dry_run }}
run: |
"$GITHUB_ACTION_PATH/update-without-release.sh"
- name: Update release branch
if: steps.check_branch_behind.outputs.branch_up_to_date == 'true' && steps.version_check.outputs.continue_release == 'true'
shell: bash
env:
DRY_RUN: ${{ inputs.dry_run }}
run: |
"$GITHUB_ACTION_PATH/update-release-branch.sh"