mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-25 07:39:25 +08:00
Use workflow fixes from main
This commit is contained in:
parent
e164efeca4
commit
2086bbfc49
61
.github/workflows/conan-package-create.yml
vendored
61
.github/workflows/conan-package-create.yml
vendored
@ -7,6 +7,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
recipe_id_latest:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
runs_on:
|
runs_on:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@ -28,6 +32,16 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
conan_upload_community:
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
create_from_source:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
|
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
|
||||||
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
|
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
|
||||||
@ -52,10 +66,8 @@ jobs:
|
|||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
cache-dependency-path: .github/workflows/requirements-conan-package.txt
|
cache-dependency-path: .github/workflows/requirements-conan-package.txt
|
||||||
|
|
||||||
- name: Install Python requirements and Create default Conan profile
|
- name: Install Python requirements for runner
|
||||||
run: |
|
run: pip install -r .github/workflows/requirements-conan-package.txt
|
||||||
pip install -r .github/workflows/requirements-conan-package.txt
|
|
||||||
conan profile new default --detect
|
|
||||||
|
|
||||||
- name: Use Conan download cache (Bash)
|
- name: Use Conan download cache (Bash)
|
||||||
if: ${{ runner.os != 'Windows' }}
|
if: ${{ runner.os != 'Windows' }}
|
||||||
@ -90,11 +102,21 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Linux system requirements
|
- name: Install Linux system requirements
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
run: sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
|
run: |
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade
|
||||||
|
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
|
||||||
|
|
||||||
- name: Clean Conan local cache
|
- name: Install GCC-12 on ubuntu-22.04
|
||||||
if: ${{ inputs.conan_clean_local_cache }}
|
if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }}
|
||||||
run: conan remove "*" -f
|
run: |
|
||||||
|
sudo apt install g++-12 gcc-12 -y
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
|
||||||
|
|
||||||
|
- name: Create the default Conan profile
|
||||||
|
run: conan profile new default --detect
|
||||||
|
|
||||||
- name: Get Conan configuration from branch
|
- name: Get Conan configuration from branch
|
||||||
if: ${{ inputs.conan_config_branch != '' }}
|
if: ${{ inputs.conan_config_branch != '' }}
|
||||||
@ -105,10 +127,27 @@ jobs:
|
|||||||
run: conan config install https://github.com/Ultimaker/conan-config.git
|
run: conan config install https://github.com/Ultimaker/conan-config.git
|
||||||
|
|
||||||
- name: Create the Packages
|
- name: Create the Packages
|
||||||
|
if: ${{ !inputs.create_from_source }}
|
||||||
run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
|
run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
|
||||||
|
|
||||||
|
- name: Create the Packages (from source)
|
||||||
|
if: ${{ inputs.create_from_source }}
|
||||||
|
run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
|
||||||
|
|
||||||
|
- name: Remove the latest alias
|
||||||
|
if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
|
||||||
|
run: |
|
||||||
|
conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
|
||||||
|
conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
|
||||||
|
|
||||||
|
- name: Create the latest alias
|
||||||
|
if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && always() }}
|
||||||
|
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
|
||||||
|
|
||||||
- name: Upload the Package(s)
|
- name: Upload the Package(s)
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: conan upload "*" -r cura --all -c
|
||||||
conan upload "*" -r cura --all -c
|
|
||||||
conan upload "*" -r cura-ce -c
|
- name: Upload the Package(s) community
|
||||||
|
if: ${{ always() && inputs.conan_upload_community == true }}
|
||||||
|
run: conan upload "*" -r cura-ce -c
|
||||||
|
52
.github/workflows/conan-package.yml
vendored
52
.github/workflows/conan-package.yml
vendored
@ -41,10 +41,11 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 'CURA-*'
|
- 'CURA-*'
|
||||||
- '[1-9]+.[0-9]+'
|
- '[1-9].[0-9]'
|
||||||
|
- '[1-9].[0-9][0-9]'
|
||||||
tags:
|
tags:
|
||||||
- '[0-9]+.[0-9]+.[0-9]+'
|
- '[1-9].[0-9].[0-9]+'
|
||||||
- '[0-9]+.[0-9]+-beta'
|
- '[1-9].[0-9][0-9].[0-9]+'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
conan-recipe-version:
|
conan-recipe-version:
|
||||||
@ -52,48 +53,32 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
project_name: cura
|
project_name: cura
|
||||||
|
|
||||||
conan-package-export-macos:
|
conan-package-export:
|
||||||
needs: [ conan-recipe-version ]
|
needs: [ conan-recipe-version ]
|
||||||
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
|
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
|
||||||
with:
|
with:
|
||||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
||||||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
|
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
|
||||||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
|
|
||||||
runs_on: 'macos-10.15'
|
|
||||||
python_version: '3.10.x'
|
|
||||||
conan_logging_level: 'info'
|
|
||||||
conan_export_binaries: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
conan-package-export-linux:
|
|
||||||
needs: [ conan-recipe-version ]
|
|
||||||
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
|
|
||||||
with:
|
|
||||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
|
||||||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
|
|
||||||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
|
|
||||||
runs_on: 'ubuntu-20.04'
|
runs_on: 'ubuntu-20.04'
|
||||||
python_version: '3.10.x'
|
python_version: '3.10.x'
|
||||||
conan_logging_level: 'info'
|
conan_logging_level: 'info'
|
||||||
conan_export_binaries: true
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
conan-package-export-windows:
|
conan-package-create-linux:
|
||||||
needs: [ conan-recipe-version ]
|
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
|
||||||
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
|
needs: [ conan-recipe-version, conan-package-export ]
|
||||||
|
|
||||||
|
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
|
||||||
with:
|
with:
|
||||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
||||||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
|
runs_on: 'ubuntu-20.04'
|
||||||
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
|
|
||||||
runs_on: 'windows-2022'
|
|
||||||
python_version: '3.10.x'
|
python_version: '3.10.x'
|
||||||
conan_logging_level: 'info'
|
conan_logging_level: 'info'
|
||||||
conan_export_binaries: true
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
notify-export:
|
notify-export:
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
needs: [ conan-recipe-version, conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ]
|
needs: [ conan-recipe-version, conan-package-export ]
|
||||||
|
|
||||||
uses: ultimaker/cura/.github/workflows/notify.yml@main
|
uses: ultimaker/cura/.github/workflows/notify.yml@main
|
||||||
with:
|
with:
|
||||||
@ -103,3 +88,16 @@ jobs:
|
|||||||
failure_title: "Failed to export Conan Export in ${{ github.repository }}"
|
failure_title: "Failed to export Conan Export in ${{ github.repository }}"
|
||||||
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
|
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
notify-create:
|
||||||
|
if: ${{ always() && ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }}
|
||||||
|
needs: [ conan-recipe-version, conan-package-create-linux ]
|
||||||
|
|
||||||
|
uses: ultimaker/cura/.github/workflows/notify.yml@main
|
||||||
|
with:
|
||||||
|
success: ${{ contains(join(needs.*.result, ','), 'success') }}
|
||||||
|
success_title: "New binaries created in ${{ github.repository }}"
|
||||||
|
success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
|
||||||
|
failure_title: "Failed to create binaries in ${{ github.repository }}"
|
||||||
|
failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
|
||||||
|
secrets: inherit
|
||||||
|
37
.github/workflows/conan-recipe-export.yml
vendored
37
.github/workflows/conan-recipe-export.yml
vendored
@ -11,10 +11,6 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
recipe_id_pr:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
runs_on:
|
runs_on:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@ -35,6 +31,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
|
conan_upload_community:
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
|
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
|
||||||
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
|
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
|
||||||
@ -79,23 +80,27 @@ jobs:
|
|||||||
run: conan config install https://github.com/Ultimaker/conan-config.git
|
run: conan config install https://github.com/Ultimaker/conan-config.git
|
||||||
|
|
||||||
- name: Export the Package (binaries)
|
- name: Export the Package (binaries)
|
||||||
if: ${{ inputs.conan_export_binaries == 'true' }}
|
if: ${{ inputs.conan_export_binaries }}
|
||||||
run: conan export-pkg . ${{ inputs.recipe_id_full }}
|
run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
|
||||||
|
|
||||||
- name: Export the Package
|
- name: Export the Package
|
||||||
if: ${{ inputs.conan_export_binaries != 'true' && github.event_name != 'pull_request' }}
|
if: ${{ !inputs.conan_export_binaries }}
|
||||||
run: conan export . ${{ inputs.recipe_id_full }}
|
run: conan export . ${{ inputs.recipe_id_full }}
|
||||||
|
|
||||||
- name: Create the latest alias
|
- name: Remove the latest alias
|
||||||
if: ${{ inputs.recipe_id_latest != '' && github.event_name != 'pull_request' }}
|
if: ${{ inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
|
||||||
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
|
run: |
|
||||||
|
conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
|
||||||
|
conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
|
||||||
|
|
||||||
- name: Create the pull request alias
|
- name: Create the latest alias
|
||||||
if: ${{ inputs.recipe_id_pr != '' && github.event_name == 'pull_request' }}
|
if: ${{ inputs.recipe_id_latest != '' && always() }}
|
||||||
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
|
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
|
||||||
|
|
||||||
- name: Upload the Package(s)
|
- name: Upload the Package(s)
|
||||||
run: |
|
if: always()
|
||||||
# Only use --all (upload binaries) for the cura repository
|
run: conan upload "*" -r cura --all -c
|
||||||
conan upload "*" -r cura --all -c
|
|
||||||
conan upload "*" -r cura-ce -c
|
- name: Upload the Package(s) community
|
||||||
|
if: ${{ always() && inputs.conan_upload_community == true }}
|
||||||
|
run: conan upload "*" -r cura-ce -c
|
||||||
|
89
.github/workflows/conan-recipe-version.yml
vendored
89
.github/workflows/conan-recipe-version.yml
vendored
@ -7,6 +7,11 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
additional_buildmetadata:
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
type: string
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
recipe_id_full:
|
recipe_id_full:
|
||||||
description: "The full Conan recipe id: <name>/<version>@<user>/<channel>"
|
description: "The full Conan recipe id: <name>/<version>@<user>/<channel>"
|
||||||
@ -20,6 +25,10 @@ on:
|
|||||||
description: "The full semver <Major>.<Minor>.<Patch>-<PreReleaseTag>+<BuildMetaData>"
|
description: "The full semver <Major>.<Minor>.<Patch>-<PreReleaseTag>+<BuildMetaData>"
|
||||||
value: ${{ jobs.get-semver.outputs.semver_full }}
|
value: ${{ jobs.get-semver.outputs.semver_full }}
|
||||||
|
|
||||||
|
is_release_branch:
|
||||||
|
description: "is current branch a release branch?"
|
||||||
|
value: ${{ jobs.get-semver.outputs.release_branch }}
|
||||||
|
|
||||||
recipe_user:
|
recipe_user:
|
||||||
description: "The conan user"
|
description: "The conan user"
|
||||||
value: ${{ jobs.get-semver.outputs.user }}
|
value: ${{ jobs.get-semver.outputs.user }}
|
||||||
@ -37,15 +46,25 @@ jobs:
|
|||||||
recipe_id_full: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }}
|
recipe_id_full: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_full }}
|
||||||
recipe_id_latest: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }}
|
recipe_id_latest: ${{ steps.get-conan-broadcast-data.outputs.recipe_id_latest }}
|
||||||
semver_full: ${{ steps.get-conan-broadcast-data.outputs.semver_full }}
|
semver_full: ${{ steps.get-conan-broadcast-data.outputs.semver_full }}
|
||||||
|
is_release_branch: ${{ steps.get-conan-broadcast-data.outputs.is_release_branch }}
|
||||||
user: ${{ steps.get-conan-broadcast-data.outputs.user }}
|
user: ${{ steps.get-conan-broadcast-data.outputs.user }}
|
||||||
channel: ${{ steps.get-conan-broadcast-data.outputs.channel }}
|
channel: ${{ steps.get-conan-broadcast-data.outputs.channel }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||||
with:
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
fetch-depth: 3000
|
|
||||||
|
- name: Checkout repo PR
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
|
||||||
- name: Setup Python and pip
|
- name: Setup Python and pip
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
@ -73,24 +92,30 @@ jobs:
|
|||||||
event_name = "${{ github.event_name }}"
|
event_name = "${{ github.event_name }}"
|
||||||
issue_number = "${{ github.ref }}".split('/')[2]
|
issue_number = "${{ github.ref }}".split('/')[2]
|
||||||
is_tag = "${{ github.ref_type }}" == "tag"
|
is_tag = "${{ github.ref_type }}" == "tag"
|
||||||
|
is_release_branch = False
|
||||||
|
buildmetadata = "" if "${{ inputs.additional_buildmetadata }}" == "" else "${{ inputs.additional_buildmetadata }}_"
|
||||||
|
|
||||||
# FIXME: for when we push a tag (such as an release)
|
# FIXME: for when we push a tag (such as an release)
|
||||||
|
channel = "testing"
|
||||||
if is_tag:
|
if is_tag:
|
||||||
branch_version = tools.Version("${{ github.ref_name }}")
|
branch_version = tools.Version("${{ github.ref_name }}")
|
||||||
|
is_release_branch = True
|
||||||
|
channel = "_"
|
||||||
|
user = "_"
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
branch_version = tools.Version(repo.active_branch.name)
|
branch_version = tools.Version(repo.active_branch.name)
|
||||||
channel = "stable"
|
|
||||||
except ConanException:
|
except ConanException:
|
||||||
branch_version = tools.Version('0.0.0')
|
branch_version = tools.Version('0.0.0')
|
||||||
if repo.active_branch.name == f"{branch_version.major}.{branch_version.minor}":
|
if "${{ github.ref_name }}" == f"{branch_version.major}.{branch_version.minor}":
|
||||||
channel = 'stable'
|
channel = 'stable'
|
||||||
elif repo.active_branch.name == "main" or repo.active_branch.name == "master":
|
is_release_branch = True
|
||||||
|
elif "${{ github.ref_name }}" in ("main", "master"):
|
||||||
channel = 'testing'
|
channel = 'testing'
|
||||||
else:
|
else:
|
||||||
channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower()
|
channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower()
|
||||||
|
|
||||||
if event_name == "pull_request":
|
if "pull_request" in event_name:
|
||||||
channel = f"pr_{issue_number}"
|
channel = f"pr_{issue_number}"
|
||||||
|
|
||||||
# %% Get the actual version
|
# %% Get the actual version
|
||||||
@ -105,27 +130,40 @@ jobs:
|
|||||||
latest_branch_version = version
|
latest_branch_version = version
|
||||||
latest_branch_tag = repo.tag(tag)
|
latest_branch_tag = repo.tag(tag)
|
||||||
|
|
||||||
# %% Get the actual version
|
if latest_branch_tag:
|
||||||
no_commits = 0
|
# %% Get the actual version
|
||||||
for commit in repo.iter_commits("HEAD"):
|
no_commits = 0
|
||||||
if commit == latest_branch_tag.commit:
|
for commit in repo.iter_commits("HEAD"):
|
||||||
break
|
if commit == latest_branch_tag.commit:
|
||||||
no_commits += 1
|
break
|
||||||
|
no_commits += 1
|
||||||
if no_commits == 0:
|
|
||||||
# This is a release
|
if no_commits == 0:
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}"
|
# This is a release
|
||||||
if channel == "stable":
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}"
|
||||||
user = "_"
|
if channel == "stable":
|
||||||
channel = "_"
|
user = "_"
|
||||||
else:
|
channel = "_"
|
||||||
if event_name == "pull_request":
|
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+pr_{issue_number}_{no_commits}"
|
|
||||||
else:
|
else:
|
||||||
if latest_branch_version.prerelease == "":
|
if latest_branch_version.prerelease and not "." in latest_branch_version.prerelease:
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-alpha+{no_commits}"
|
# The prerealese did not contain a version number, default it to 1
|
||||||
|
latest_branch_version.prerelease += ".1"
|
||||||
|
if event_name == "pull_request":
|
||||||
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}pr_{issue_number}_{no_commits}"
|
||||||
else:
|
else:
|
||||||
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{no_commits}"
|
if channel in ("stable", "_", ""):
|
||||||
|
channel_metadata = f"{no_commits}"
|
||||||
|
else:
|
||||||
|
channel_metadata = f"{channel}_{no_commits}"
|
||||||
|
# FIXME: for when we create a new release branch
|
||||||
|
if latest_branch_version.prerelease == "":
|
||||||
|
bump_up_minor = int(latest_branch_version.minor) + 1
|
||||||
|
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{latest_branch_version.patch}-alpha+{buildmetadata}{channel_metadata}"
|
||||||
|
else:
|
||||||
|
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.lower()}+{buildmetadata}{channel_metadata}"
|
||||||
|
else:
|
||||||
|
# FIXME: for external PR's
|
||||||
|
actual_version = f"5.2.0-alpha+{buildmetadata}pr_{issue_number}"
|
||||||
|
|
||||||
# %% print to output
|
# %% print to output
|
||||||
cmd_name = ["echo", f"::set-output name=name::{project_name}"]
|
cmd_name = ["echo", f"::set-output name=name::{project_name}"]
|
||||||
@ -140,6 +178,8 @@ jobs:
|
|||||||
subprocess.call(cmd_id_latest)
|
subprocess.call(cmd_id_latest)
|
||||||
cmd_semver_full = ["echo", f"::set-output name=semver_full::{actual_version}"]
|
cmd_semver_full = ["echo", f"::set-output name=semver_full::{actual_version}"]
|
||||||
subprocess.call(cmd_semver_full)
|
subprocess.call(cmd_semver_full)
|
||||||
|
cmd_is_release_branch = ["echo", f"::set-output name=is_release_branch::{str(is_release_branch).lower()}"]
|
||||||
|
subprocess.call(cmd_is_release_branch)
|
||||||
|
|
||||||
print("::group::Conan Recipe Information")
|
print("::group::Conan Recipe Information")
|
||||||
print(f"name = {project_name}")
|
print(f"name = {project_name}")
|
||||||
@ -149,5 +189,6 @@ jobs:
|
|||||||
print(f"recipe_id_full = {project_name}/{actual_version}@{user}/{channel}")
|
print(f"recipe_id_full = {project_name}/{actual_version}@{user}/{channel}")
|
||||||
print(f"recipe_id_latest = {project_name}/latest@{user}/{channel}")
|
print(f"recipe_id_latest = {project_name}/latest@{user}/{channel}")
|
||||||
print(f"semver_full = {actual_version}")
|
print(f"semver_full = {actual_version}")
|
||||||
|
print(f"is_release_branch = {str(is_release_branch).lower()}")
|
||||||
print("::endgroup::")
|
print("::endgroup::")
|
||||||
shell: python
|
shell: python
|
||||||
|
46
.github/workflows/cura-installer.yml
vendored
46
.github/workflows/cura-installer.yml
vendored
@ -5,11 +5,10 @@ on:
|
|||||||
inputs:
|
inputs:
|
||||||
cura_conan_version:
|
cura_conan_version:
|
||||||
description: 'Cura Conan Version'
|
description: 'Cura Conan Version'
|
||||||
# Fixme: default to cura/latest@testing (which is main)
|
default: 'cura/latest@ultimaker/testing'
|
||||||
default: 'cura/latest@ultimaker/stable'
|
|
||||||
required: true
|
required: true
|
||||||
conan_args:
|
conan_args:
|
||||||
description: 'Conan args: eq.: --require-override=curaengine/5.1.0-beta+123@ultimaker/testing'
|
description: 'Conan args: eq.: --require-override'
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
conan_config:
|
conan_config:
|
||||||
@ -62,10 +61,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { os: macos-10.15, os_id: 'MacOS' }
|
- { os: macos-11, os_id: 'mac' }
|
||||||
- { os: windows-2022, os_id: 'Windows' }
|
- { os: windows-2022, os_id: 'win64' }
|
||||||
- { os: ubuntu-20.04, os_id: 'Linux' }
|
- { os: ubuntu-20.04, os_id: 'linux' }
|
||||||
- { os: ubuntu-22.04, os_id: 'Linux-latest' }
|
- { os: ubuntu-22.04, os_id: 'linux-modern' }
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -78,10 +77,8 @@ jobs:
|
|||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
cache-dependency-path: .github/workflows/requirements-conan-package.txt
|
cache-dependency-path: .github/workflows/requirements-conan-package.txt
|
||||||
|
|
||||||
- name: Install Python requirements and Create default Conan profile
|
- name: Install Python requirements for runner
|
||||||
run: |
|
run: pip install -r .github/workflows/requirements-conan-package.txt
|
||||||
pip install -r .github/workflows/requirements-conan-package.txt
|
|
||||||
conan profile new default --detect
|
|
||||||
|
|
||||||
- name: Use Conan download cache (Bash)
|
- name: Use Conan download cache (Bash)
|
||||||
if: ${{ runner.os != 'Windows' }}
|
if: ${{ runner.os != 'Windows' }}
|
||||||
@ -117,11 +114,24 @@ jobs:
|
|||||||
- name: Install Linux system requirements
|
- name: Install Linux system requirements
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
run: |
|
run: |
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade
|
||||||
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
|
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
|
||||||
wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool
|
wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool
|
||||||
chmod +x $GITHUB_WORKSPACE/appimagetool
|
chmod +x $GITHUB_WORKSPACE/appimagetool
|
||||||
echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
|
echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install GCC-12 on ubuntu-22.04
|
||||||
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
||||||
|
run: |
|
||||||
|
sudo apt install g++-12 gcc-12 -y
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
|
||||||
|
|
||||||
|
- name: Create the default Conan profile
|
||||||
|
run: conan profile new default --detect
|
||||||
|
|
||||||
- name: Configure GPG Key Linux (Bash)
|
- name: Configure GPG Key Linux (Bash)
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import
|
run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import
|
||||||
@ -192,34 +202,34 @@ jobs:
|
|||||||
|
|
||||||
- name: Archive the artifacts (bash)
|
- name: Archive the artifacts (bash)
|
||||||
if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
|
if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
|
||||||
run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/"
|
run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.tar.gz" "./Ultimaker-Cura/"
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Archive the artifacts (Powershell)
|
- name: Archive the artifacts (Powershell)
|
||||||
if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
|
if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
|
||||||
run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.zip"
|
run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.zip"
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Create the Windows exe installer (Powershell)
|
- name: Create the Windows exe installer (Powershell)
|
||||||
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
|
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
|
||||||
run: |
|
run: |
|
||||||
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.exe"
|
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.exe"
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Create the Linux AppImage (Bash)
|
- name: Create the Linux AppImage (Bash)
|
||||||
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
|
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
|
||||||
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.AppImage"
|
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.AppImage"
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Create the MacOS dmg (Bash)
|
- name: Create the MacOS dmg (Bash)
|
||||||
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
|
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
|
||||||
run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}-${{ runner.arch }}.dmg"
|
run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.dmg"
|
||||||
working-directory: dist
|
working-directory: dist
|
||||||
|
|
||||||
- name: Upload the artifacts
|
- name: Upload the artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}-${{ runner.arch }}
|
name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}
|
||||||
path: |
|
path: |
|
||||||
dist/*.tar.gz
|
dist/*.tar.gz
|
||||||
dist/*.zip
|
dist/*.zip
|
||||||
@ -228,7 +238,7 @@ jobs:
|
|||||||
dist/*.dmg
|
dist/*.dmg
|
||||||
dist/*.AppImage
|
dist/*.AppImage
|
||||||
dist/*.asc
|
dist/*.asc
|
||||||
retention-days: 2
|
retention-days: 5
|
||||||
|
|
||||||
notify-export:
|
notify-export:
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
conan
|
conan!=1.51.0,!=1.51.1,!=1.51.2,!=1.51.3,!=1.52.0
|
||||||
sip==6.5.1
|
sip
|
||||||
|
13
.github/workflows/unit-test.yml
vendored
13
.github/workflows/unit-test.yml
vendored
@ -103,7 +103,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Install Linux system requirements
|
- name: Install Linux system requirements
|
||||||
if: ${{ runner.os == 'Linux' }}
|
if: ${{ runner.os == 'Linux' }}
|
||||||
run: sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev -y
|
run: |
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade
|
||||||
|
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
|
||||||
|
|
||||||
|
- name: Install GCC-12 on ubuntu-22.04
|
||||||
|
if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }}
|
||||||
|
run: |
|
||||||
|
sudo apt install g++-12 gcc-12 -y
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
|
||||||
|
|
||||||
- name: Get Conan configuration
|
- name: Get Conan configuration
|
||||||
run: conan config install https://github.com/Ultimaker/conan-config.git
|
run: conan config install https://github.com/Ultimaker/conan-config.git
|
||||||
|
Loading…
x
Reference in New Issue
Block a user