Skip to content

Commit 368dfd1

Browse files
a4zpatricia-gallardo
authored andcommitted
Add optional version input
1 parent 1aa9b71 commit 368dfd1

File tree

3 files changed

+56
-7
lines changed

3 files changed

+56
-7
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
os: [ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2019]
10+
os: [ubuntu-latest, macos-latest, windows-latest]
1111

1212
runs-on: ${{ matrix.os }}
13-
13+
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
@@ -21,3 +21,22 @@ jobs:
2121

2222
- name: Did we get Conan?
2323
run: echo "Conan version was '${{ steps.conan.outputs.version }}'"
24+
25+
build_version:
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [ubuntu-latest, macos-latest, windows-latest]
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
- name: Get Conan
37+
id: conan
38+
uses: ./ # Uses an action in the root directory
39+
with:
40+
version: 1.50.0
41+
- name: Did we get Conan?
42+
run: echo "Conan version was '${{ steps.conan.outputs.version }}'"

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Gets the most recent Conan
55

6-
**Works on**: Linux, Windows and MacOS
6+
**Works on**: Linux, Windows and MacOS
77

88
## Inputs
99

@@ -17,10 +17,25 @@ The version string from "conan --version"
1717

1818
## Example usage
1919

20+
To install the latest conan version
21+
22+
~~~~
23+
- name: Install Conan
24+
id: conan
25+
uses: turtlebrowser/get-conan@main
26+
27+
- name: Conan version
28+
run: echo "${{ steps.conan.outputs.version }}"
29+
~~~~
30+
31+
It is also possible to specify the wanted conan version, by using the with:/version input to the action.
32+
2033
~~~~
2134
- name: Install Conan
2235
id: conan
2336
uses: turtlebrowser/get-conan@main
37+
with:
38+
version: 1.50.0
2439
2540
- name: Conan version
2641
run: echo "${{ steps.conan.outputs.version }}"

action.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
name: 'Get Conan'
22
description: 'Installs Conan'
33
author: 'TurtleBrowser'
4+
inputs:
5+
version:
6+
description: "Wanted conan version"
7+
required: false
8+
default: ''
49
outputs:
510
version:
611
description: "The version of Conan which was installed"
712
value: ${{ steps.output_version.outputs.version }}
813
runs:
914
using: "composite"
1015
steps:
11-
- name: Install on Mac/Linux/Windows
12-
run: |
13-
pip3 install wheel setuptools
14-
pip3 install conan --upgrade
16+
- name: Install setup tools
17+
run: pip3 install wheel setuptools
18+
shell: bash
19+
- name: Install conan latest
20+
if: ${{ inputs.version == '' }}
21+
run: pip3 install conan --upgrade
22+
shell: bash
23+
- name: Install conan version ${{ inputs.version }}
24+
if: ${{ inputs.version != '' }}
25+
run: pip3 install conan==${{ inputs.version }} --upgrade
1526
shell: bash
1627
- name: Fix path on Linux
1728
run: |
@@ -26,3 +37,7 @@ runs:
2637
branding:
2738
icon: "archive"
2839
color: "green"
40+
41+
42+
43+

0 commit comments

Comments
 (0)