Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into CURA-11622_conan_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Sep 5, 2024
2 parents 730bfd7 + cd01717 commit 9c09464
Show file tree
Hide file tree
Showing 16 changed files with 342 additions and 132 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/conan-package-create-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
default: ""
type: string

conan_recipe_root:
required: false
default: "."
type: string

permissions:
contents: read

Expand Down Expand Up @@ -110,7 +115,7 @@ jobs:
${{ runner.os }}-conan-
- name: Create the Package (binaries)
run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }}
run: conan create ${{ inputs.conan_recipe_root }} --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 }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/conan-package-create-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
default: ""
type: string

conan_recipe_root:
required: false
default: "."
type: string

permissions:
contents: read

Expand All @@ -43,7 +48,7 @@ env:

jobs:
package-create:
runs-on: macos-11
runs-on: macos-12

steps:
- name: Checkout repo
Expand Down Expand Up @@ -110,7 +115,7 @@ jobs:
${{ runner.os }}-conan-
- name: Create the Package (binaries)
run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }}
run: conan create ${{ inputs.conan_recipe_root }} --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 }}
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/conan-package-create-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Conan package create Wasm

on:
workflow_call:
inputs:
recipe_id_full:
required: true
type: string

conan_internal:
required: false
default: false
type: boolean

conan_extra_args:
required: false
default: ""
type: string

conan_recipe_root:
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-create:
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 }}

- name: Sync pip requirements
run: wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.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: Install Linux system requirements for building
run: |
mkdir -p runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh -O runner_scripts/ubuntu_setup.sh
chmod +x runner_scripts/ubuntu_setup.sh
sudo ./runner_scripts/ubuntu_setup.sh
- name: Setup pipeline caches
run: |
mkdir -p /home/runner/.conan/downloads
- name: Create default Conan profile
run: conan profile new default --detect

- name: Get Conan configuration
run: |
conan config install https://github.com/Ultimaker/conan-config.git
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
- name: Add runner credentials to cura remote
run: conan user -p ${{ secrets.CONAN_PASS }} -r cura ${{ secrets.CONAN_USER }}

- name: Add Cura private Artifactory remote
if: ${{ inputs.conan_internal }}
run: |
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/internal"
conan user -p ${{ secrets.CONAN_PASS }} -r cura-private ${{ secrets.CONAN_USER }}
- name: Cache Conan downloads
uses: actions/cache@v3
with:
path: /home/runner/.conan/downloads
key: ${{ runner.os }}-conan-downloads-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-conan-downloads-
- name: Export the Package (binaries)
run: conan create ${{ inputs.conan_recipe_root }} ${{ inputs.recipe_id_full }} --build=missing --update ${{ inputs.conan_extra_args }} -pr:h cura_wasm.jinja

- name: Upload the Package(s)
if: ${{ always() && !inputs.conan_internal }}
run: |
conan upload ${{ inputs.recipe_id_full }} -r cura --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
7 changes: 6 additions & 1 deletion .github/workflows/conan-package-create-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
default: ""
type: string

conan_recipe_root:
required: false
default: "."
type: string

permissions:
contents: read

Expand Down Expand Up @@ -104,7 +109,7 @@ jobs:
${{ runner.os }}-conan-
- name: Create the Package (binaries)
run: conan create . --name ${{ inputs.recipe_id_name }} --version ${{ inputs.recipe_id_version }} --user ${{ inputs.recipe_id_user }} --channel ${{ inputs.recipe_id_channel }} ${{ inputs.conan_extra_args }}
run: conan create ${{ inputs.conan_recipe_root }} --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 }}
Expand Down
61 changes: 40 additions & 21 deletions .github/workflows/conan-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,10 @@ on:
default: true
type: boolean

conan_user:
description: 'Conan user (_, ultimaker, internal)'
conan_user_channel:
description: 'Conan user and channel (_/_, ultimaker/testing, internal/testings)'
required: false
default: '_'
type: string

conan_channel:
description: 'Conan channel (_, testing, stable)'
required: false
default: '_'
default: '_/_'
type: string

conan_internal:
Expand All @@ -77,6 +71,12 @@ on:
default: ''
type: string

conan_recipe_root:
required: false
default: "."
description: 'location of the conanfile.py defaults to `.`'
type: string

workflow_call:
inputs:
organization:
Expand All @@ -97,14 +97,14 @@ on:
required: true
type: string

conan_user:
conan_release:
required: false
default: '_'
type: string
default: true
type: boolean

conan_channel:
conan_user_channel:
required: false
default: '_'
default: '_/_'
type: string

conan_internal:
Expand All @@ -122,16 +122,22 @@ on:
default: ''
type: string

conan_recipe_root:
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
runs-on: self-hosted-Ubuntu22-X64

steps:
- name: Checkout repo
Expand Down Expand Up @@ -163,7 +169,7 @@ jobs:
mkdir -p /home/runner/.conan/downloads
- name: Create default Conan profile
run: conan profile new default --detect
run: conan profile new default --detect --force

- name: Get Conan configuration
run: |
Expand All @@ -187,17 +193,30 @@ jobs:

- name: Get basic project info
run: |
echo "CONAN_PROJECT_NAME=$(conan inspect . | awk '/^name:/ {print $2}')" >> $GITHUB_ENV
echo "CONAN_PROJECT_NAME=$(conan inspect ${{ inputs.conan_recipe_root }} | awk '/^name:/ {print $2}')" >> $GITHUB_ENV
- id: get-conan-broadcast-data
name: Get Conan broadcast data
run: |
mkdir runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/get_conan_broadcast_data.py -O runner_scripts/get_conan_broadcast_data.py
python runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.conan_user }} --channel ${{ inputs.conan_channel }} --project_name $CONAN_PROJECT_NAME --release ${{ inputs.conan_release }} --version ${{ inputs.version }}
python runner_scripts/get_conan_broadcast_data.py --user_channel ${{ inputs.conan_user_channel }} --project_name $CONAN_PROJECT_NAME --release ${{ inputs.conan_release }} --version ${{ inputs.version }}
- name: Install system requirements for building
run: |
mkdir -p runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh -O runner_scripts/ubuntu_setup.sh
chmod +x runner_scripts/ubuntu_setup.sh
sudo ./runner_scripts/ubuntu_setup.sh
- id: export-package
name: Export the Package
if: ${{ inputs.conan_recipe_root != '.' || (inputs.repository != 'Cura' && inputs.repository!='Uranium') }}
run: conan export ${{ inputs.conan_recipe_root }} ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }}

- name: Export the Package
run: conan export . ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }}
- name: Create conan for Uranium and Cura
if: ${{ steps.export-package.conclusion == 'skipped' }}
run: conan create . ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }} ${{ inputs.conan_extra_args }} --build=missing --update -o cura:devtools=True -o *:enable_i18n=True -c user.i18n:options="{'extract':True,'build':True}"

- name: Create the latest alias
if: ${{ inputs.conan_latest }}
Expand All @@ -217,4 +236,4 @@ jobs:

- name: Upload the latest Package(s) to the private Artifactory
if: ${{ inputs.conan_internal && inputs.conan_latest }}
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura-private -c
run: conan upload ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }} -r cura-private -c
7 changes: 6 additions & 1 deletion .github/workflows/conan-recipe-export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
default: ""
type: string

conan_recipe_root:
required: false
default: "."
type: string

permissions:
contents: read

Expand Down Expand Up @@ -91,7 +96,7 @@ jobs:
conan remote login cura-private-conan2 ${{ secrets.CONAN_USER }} -p ${{ secrets.CONAN_PASS }}
- 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 }}
run: conan export ${{ inputs.conan_recipe_root }} --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: ${{ !inputs.conan_internal}}
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/conan-recipe-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ jobs:
sparse-checkout: 'conandata.yml'
ref: ${{ github.base_ref }}

- name: Checkout Cura-workflows repo
uses: actions/checkout@v4
with:
repository: Ultimaker/Cura-workflows
# FIXME: use main once merged
ref: CURA-11622_conan_v2
path: Cura-workflows

- name: Setup Python and pip
uses: actions/setup-python@v4
with:
Expand All @@ -93,6 +101,4 @@ jobs:
- id: get-conan-broadcast-data
name: Get Conan broadcast data
run: |
mkdir runner_scripts
wget https://raw.githubusercontent.com/Ultimaker/cura-workflows/CURA-11622_conan_v2/runner_scripts/get_conan_broadcast_data.py -O runner_scripts/get_conan_broadcast_data.py
python runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.user }} --project_name "${{ inputs.project_name }}" --sha "${{ github.sha }}" --event_name "${{ github.event_name }}" --base_ref "${{ github.base_ref }}" --ref_name "${{ github.ref_name }}" --release "${{ inputs.release }}" --version "${{ inputs.version }}"
python Cura-workflows/runner_scripts/get_conan_broadcast_data.py --user ${{ inputs.user }} --project_name "${{ inputs.project_name }}" --sha "${{ github.sha }}" --event_name "${{ github.event_name }}" --ref_name "${{ github.ref_name }}" --head_ref "${{ github.head_ref }}" --release "${{ inputs.release }}" --version "${{ inputs.version }}"
Loading

0 comments on commit 9c09464

Please sign in to comment.