Skip to content

Deploy Conan package #22

Deploy Conan package

Deploy Conan package #22

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: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install bumpver
- name: Bump version & commit
id: bump_ver
uses: bentoudev/bump-version@main
with:
version_upgrade: ${{ github.event.inputs.version_upgrade }}
commit_user_name: ${{ github.event.inputs.commit_user_name }}
commit_user_email: ${{ github.event.inputs.commit_user_email }}
deploy_conan:
if: ${{ always() }}
name: 'Deploy'
needs: [ bump_version, test_acceptance ]
runs-on: windows-latest
steps:
# Bumped ver checkout
- uses: actions/checkout@v4
if: ${{ github.event.inputs.version_upgrade != 'none' }}
with:
ref: ${{ needs.bump_version.outputs.new_sha }}
fetch-depth: 0
# Normal checkout
- uses: actions/checkout@v4
if: ${{ github.event.inputs.version_upgrade == 'none' }}
- 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@v4
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 }}