build and push #148
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build and push | |
| description: build a conan package and push it to artifactory | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: 'package name' | |
| required: true | |
| version: | |
| description: 'package version' | |
| required: true | |
| conanfile_path: | |
| description: 'the conanfile.py path of the package ' | |
| required: true | |
| default: 'all/conanfile.py' | |
| repository: | |
| description: 'Choose Artifactory repository' | |
| required: false | |
| type: choice | |
| options: | |
| - production | |
| - testing | |
| default: 'production' | |
| user_channel: | |
| description: 'define the user and channel for the package ' | |
| required: false | |
| default: '' | |
| extra_options: | |
| description: 'extra conan options (e.g. -o pkg:opt=val -c conf=val)' | |
| required: false | |
| default: '' | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Conan and dependencies | |
| run: | | |
| pip install --user conan==2.25.1 pyyaml | |
| conan --version | |
| conan profile detect | |
| - name: Build and push | |
| env: | |
| JFROG_USERNAME2: ${{ secrets.JFROG_USERNAME2 }} | |
| JFROG_PASSWORD2: ${{ secrets.JFROG_PASSWORD2 }} | |
| INPUT_PACKAGE: ${{ github.event.inputs.package }} | |
| INPUT_VERSION: ${{ github.event.inputs.version }} | |
| INPUT_CONANFILE: ${{ github.event.inputs.conanfile_path }} | |
| INPUT_REPOSITORY: ${{ github.event.inputs.repository }} | |
| INPUT_USER_CHANNEL: ${{ github.event.inputs.user_channel }} | |
| INPUT_EXTRA_OPTIONS: ${{ github.event.inputs.extra_options }} | |
| run: | | |
| ARGS=("$INPUT_PACKAGE" "$INPUT_VERSION" --conanfile "$INPUT_CONANFILE" --repository "$INPUT_REPOSITORY") | |
| if [ -n "$INPUT_USER_CHANNEL" ]; then | |
| ARGS+=(--user-channel "$INPUT_USER_CHANNEL") | |
| fi | |
| if [ -n "$INPUT_EXTRA_OPTIONS" ]; then | |
| ARGS+=(--extra-options "$INPUT_EXTRA_OPTIONS") | |
| fi | |
| ./scripts/build-and-push.sh "${ARGS[@]}" |