Skip to content

Commit

Permalink
feat: build and push pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Yellow Shine <[email protected]>
  • Loading branch information
yellow-shine committed Nov 14, 2024
1 parent f536f0f commit edd42b4
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: build and push package to artifactory
description: build a conan package and push it to artifactory
on:
workflow_dispatch:
inputs:

package:
description: 'package name'
required: true
version:
description: 'package version'
required: true

conanfile_path:
description: 'the conanfile.py path of the package '
required: true
default: 'all/conanfile.py'

repository:
description: 'Choose Artifactory repository'
required: false
type: choice
options:
- production
- testing
default: 'testing'

user_channel:
description: 'define the user and channel for the package '
required: false
default: ''
jobs:
sync-conan-package:
runs-on: ubuntu-latest
env:
CONAN_REVISIONS_ENABLED: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install Conan
run: |
pip install --user conan==1.65.0
conan --version
- name: Configure Conan remote
run: |
if [ "${{ github.event.inputs.repository }}" = "production" ]; then
conan remote add artifactory https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
else
# for testing purpose
conan remote add artifactory https://milvus01.jfrog.io/artifactory/api/conan/testing
fi
# List remote Conan repositories; should include Conan Center by default
conan remote list
- name: build a package
run: |
conanfile_path="${{ github.event.inputs.package }}/${{ github.event.inputs.conanfile_path }}"
conan create $conanfile_path ${{ github.event.inputs.package }}/${{ github.event.inputs.version }}@ --build=missing -s compiler=gcc -s compiler.version=11 -s compiler.libcxx=libstdc++11 -s build_type=Release
- name: inspect built package
run: |
conan search '*' --revisions
- name: Upload
run: |
conan user -p ${{ secrets.JFROG_PASSWORD }} -r artifactory ${{ secrets.JFROG_USERNAME }}
# upload all packages
# Upload only the Conan recipe to the specified local repository, excluding binaries
conan upload '*' -r artifactory -c

0 comments on commit edd42b4

Please sign in to comment.