-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
74 lines (74 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
69
70
71
72
73
74
name: 'Control multi version action'
description: 'A Github Action that control multi version in project'
inputs:
version_file_path:
description: 'Enter a file path'
required: true
default: "version.gradle"
pr_labels:
description: 'pr labels string'
required: true
default: ""
version_name_dev:
description: 'version name dev variable name'
required: false
version_name_stg:
description: 'version name stg variable name'
required: false
version_name_prod:
description: 'version name prod variable name'
required: false
version_code_dev:
description: 'version_code_dev_variable_name'
required: false
version_code_stg:
description: 'version_code_stg_variable_name'
required: false
version_code_prod:
description: 'version_code_prod_variable_name'
required: false
outputs:
current_version_name:
description: 'current version name'
value: $CURRENT_VERSION_NAME
next_version_name:
description: 'next version name'
value: $NEXT_VERSION_NAME
current_version_code:
description: 'current version code'
value: $CURRENT_VERSION_CODE
next_version_code:
description: 'next version code'
value: $NEXT_VERSION_CODE
runs:
using: 'composite'
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip freeze > requirements.txt
pip install -r requirements.txt
pip install requests
shell: bash
- name: Pass Inputs to Shell
run: |
echo "FILE-PATH=${{ inputs.version_file_path }}" >> $GITHUB_ENV
echo "PR-LABELS=${{ inputs.pr_labels }}" >> $GITHUB_ENV
echo "VERSION-NAME-DEV=${{ inputs.version_name_dev }}" >> $GITHUB_ENV
echo "VERSION-NAME-STG=${{ inputs.version_name_stg }}" >> $GITHUB_ENV
echo "VERSION-NAME-PROD=${{ inputs.version_name_prod }}" >> $GITHUB_ENV
echo "VERSION-CODE-DEV=${{ inputs.version_code_dev }}" >> $GITHUB_ENV
echo "VERSION-CODE-STG=${{ inputs.version_code_stg }}" >> $GITHUB_ENV
echo "VERSION-CODE-PROD=${{ inputs.version_code_prod }}" >> $GITHUB_ENV
shell: bash
- name: Execute Python Script
id: bump_version
run: python ${{github.action_path}}/src/control_multi_version.py
shell: bash
branding:
icon: 'play'
color: 'blue'