Skip to content

Deploy Conan package #12

Deploy Conan package

Deploy Conan package #12

Workflow file for this run

name: Deploy Conan package
on:
workflow_dispatch:
inputs:
version_upgrade:
description: 'Which part of semantic version do you want to increment?'
required: true
default: '--patch'
type: choice
options:
- '--patch'
- '--minor'
- '--major'
- 'none'
profile:
description: 'Conan profile to use'
required: true
type: string
default: 'windows_msvc'
commit_user_name:
description: Name used for the commit user
required: false
default: github-actions[bot]
commit_user_email:
description: Email address used for the commit user
required: false
default: github-actions[bot]@users.noreply.github.com
jobs:
test_acceptance:
uses: ./.github/workflows/test_acceptance.yml
secrets: inherit
bump_version:
if: ${{ github.event.inputs.version_upgrade != 'none' }}
needs: [ test_acceptance ]
runs-on: ubuntu-latest
outputs:
new_sha: ${{ steps.bump_ver.outputs.new_sha }}
new_version: ${{ steps.bump_ver.outputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install bumpver
- name: Setup author
run: |
git config --global user.email ${{ github.event.inputs.commit_user_email }}
git config --global user.name ${{ github.event.inputs.commit_user_name }}
- name: Bump version & commit
id: bump_ver
uses: bentoudev/bump-version@main
with:
version_upgrade: ${{ github.event.inputs.version_upgrade }}
deploy_conan:
name: 'Deploy'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Get Conan
id: conan
uses: turtlebrowser/[email protected]
- name: Install conan profile
run: conan config install profiles/${{ inputs.profile }} -tf profiles
- name: Setup remote repository
run: conan remote add DEPS_REMOTE ${{ secrets.CONAN_REMOTE_URL }}
- name: Cache Conan packages
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan-packages
with:
path: ~/.conan2/p
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.ini') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-conan.outputs.cache-hit == 'true' }}
name: List the state of Conan packages
continue-on-error: true
run: conan list "*"
- name: Get LLVM
run: choco upgrade llvm
- name: Install zetsubou
run: pip install zetsubou --upgrade --no-cache-dir
shell: bash
- name: Create Conan package
uses: bentoudev/conan-create@main
with:
package_id: --name=${{ inputs.package }} --user=bentou --channel=stable
recipe_dir: conanfile.py
options: >
-pr:h=${{ github.event.inputs.profile }}
-pr:b=${{ github.event.inputs.profile }}
-s build_type=Release
--build=missing
- name: Upload to Conan
uses: bentoudev/conan-upload@main
with:
package_name: agnes
remote_url: ${{ secrets.CONAN_REMOTE_URL }}
user: ${{ secrets.CONAN_REMOTE_USER }}
password: ${{ secrets.CONAN_REMOTE_PASSWORD }}