├── .github └── workflows │ └── main.yml ├── LICENSE ├── README.md └── action.yml /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | workflow_dispatch: 10 | 11 | jobs: 12 | build: 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: [ubuntu-latest, macos-latest, windows-latest] 17 | 18 | runs-on: ${{ matrix.os }} 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v2 23 | 24 | - name: Get Conan 25 | id: conan 26 | uses: ./ # Uses an action in the root directory 27 | 28 | - name: Did we get Conan? 29 | run: echo "Conan version was '${{ steps.conan.outputs.version }}'" 30 | 31 | build_version: 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | os: [ubuntu-latest, macos-latest, windows-latest] 36 | 37 | runs-on: ${{ matrix.os }} 38 | 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@v2 42 | - name: Get Conan 43 | id: conan 44 | uses: ./ # Uses an action in the root directory 45 | with: 46 | version: 1.50.0 47 | - name: Did we get Conan? 48 | run: echo "Conan version was '${{ steps.conan.outputs.version }}'" 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 TurtleBrowser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![CI](https://github.com/turtlebrowser/get-conan/workflows/CI/badge.svg) 2 | # Get Conan GitHub Action 3 | 4 | Gets the most recent Conan 5 | 6 | **Works on**: Linux, Windows and MacOS 7 | 8 | ## Inputs 9 | 10 | No inputs 11 | 12 | ## Outputs 13 | 14 | ### `version` 15 | 16 | The version string from "conan --version" 17 | 18 | ## Example usage 19 | 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 | 33 | ~~~~ 34 | - name: Install Conan 35 | id: conan 36 | uses: turtlebrowser/get-conan@main 37 | with: 38 | version: 1.50.0 39 | 40 | - name: Conan version 41 | run: echo "${{ steps.conan.outputs.version }}" 42 | ~~~~ 43 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Get Conan' 2 | description: 'Installs Conan' 3 | author: 'TurtleBrowser' 4 | inputs: 5 | version: 6 | description: "Wanted conan version" 7 | required: false 8 | default: '' 9 | outputs: 10 | version: 11 | description: "The version of Conan which was installed" 12 | value: ${{ steps.output_version.outputs.version }} 13 | runs: 14 | using: "composite" 15 | steps: 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 26 | shell: bash 27 | - name: Fix path on Linux 28 | run: | 29 | echo "/home/runner/.local/bin" >> $GITHUB_PATH 30 | shell: bash 31 | - name: Fill in output variable 32 | id: output_version 33 | shell: bash 34 | run: | 35 | conan --version 36 | echo "version=$(conan --version)" >> $GITHUB_OUTPUT 37 | branding: 38 | icon: "archive" 39 | color: "green" 40 | --------------------------------------------------------------------------------