Don't use latest input #3
This file contains 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: Export Conan Recipe to server | ||
on: | ||
workflow_call: | ||
inputs: | ||
recipe_id_name: | ||
required: true | ||
type: string | ||
recipe_id_version: | ||
required: true | ||
type: string | ||
recipe_id_user: | ||
required: true | ||
type: string | ||
recipe_id_channel: | ||
required: true | ||
type: string | ||
recipe_id_full: | ||
required: true | ||
type: string | ||
conan_internal: | ||
required: false | ||
default: false | ||
type: boolean | ||
conan_extra_args: | ||
required: false | ||
default: "" | ||
type: string | ||
permissions: | ||
contents: read | ||
env: | ||
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} | ||
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} | ||
SENTRY_TOKEN: ${{ secrets.CURAENGINE_SENTRY_TOKEN }} | ||
jobs: | ||
package-export: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.head_ref }} | ||
- name: Checkout repo PR | ||
uses: actions/checkout@v4 | ||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.base_ref }} | ||
# FIXME: use main once merged | ||
- name: Sync pip requirements | ||
run: wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/CURA-11622_conan_v2/.github/workflows/requirements-runner.txt -O .github/workflows/requirements-runner.txt | ||
- name: Setup Python and pip | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11.x | ||
cache: pip | ||
cache-dependency-path: .github/workflows/requirements-runner.txt | ||
- name: Install Python requirements and Create default Conan profile | ||
run: pip install -r .github/workflows/requirements-runner.txt | ||
- name: Setup pipeline caches | ||
run: | | ||
mkdir -p /home/runner/.conan2/p | ||
- name: Create default Conan profile | ||
run: conan profile detect -f | ||
# FIXME: use runner.os/runner.arch after merge: conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}" | ||
- name: Get Conan configuration | ||
run: | | ||
conan config install https://github.com/Ultimaker/conan-config.git -a "-b CURA-11622_conan_v2" | ||
# conan remote disable cura-private | ||
conan remote login -p ${{ secrets.CONAN_PASS }} cura-conan-v2 ${{ secrets.CONAN_USER }} | ||
- name: Add Cura private Artifactory remote | ||
if: ${{ inputs.conan_internal }} | ||
run: | | ||
conan remote enable cura-private | ||
conan remote login -p ${{ secrets.CONAN_PASS }} cura-private ${{ secrets.CONAN_USER }} | ||
- name: Cache Conan | ||
uses: actions/cache@v3 | ||
with: | ||
path: /home/runner/.conan2/p | ||
key: ${{ runner.os }}-conan-${{ github.run_id }} | ||
restore-keys: | | ||
${{ runner.os }}-conan- | ||
- name: Export the Package | ||
run: conan export . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }} | ||
- name: Upload the Package(s) | ||
if: ${{ always() && !inputs.conan_internal}} | ||
run: | | ||
conan upload ${{ inputs.recipe_id_full }} -r cura-conan-v2 --all -c | ||
- name: Upload the Package(s) to the private Artifactory | ||
if: ${{ always() && inputs.conan_internal }} | ||
run: | | ||
conan upload ${{ inputs.recipe_id_full }} -r cura-private --all -c |