Skip to content

Commit 7e07e10

Browse files
committed
[added] yml file for github action that uploads package to artifactory using jfrog cli instead of conan directly.
1 parent 3cd0d59 commit 7e07e10

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Embedded Lib Conan Package with JFROG CLI
2+
3+
on:
4+
push:
5+
tags: [ "v*" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest
13+
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Extract version from tag
24+
id: vars
25+
run: |
26+
TAG=${GITHUB_REF#refs/tags/}
27+
VERSION=${TAG#v}
28+
echo "version=$VERSION" >> $GITHUB_OUTPUT
29+
30+
- name: Check environment
31+
run: |
32+
conan --version
33+
cmake --version
34+
gcc --version
35+
36+
# 👉 Setup JFrog CLI
37+
- uses: jfrog/setup-jfrog-cli@v3
38+
39+
- name: Configure JFrog CLI
40+
run: |
41+
jfrog rt c add emilcode \
42+
--url=https://emilcodedev.jfrog.io/artifactory \
43+
--access-token=${{ secrets.JFROG_CONAN }} \
44+
--interactive=false
45+
46+
- name: Create Conan package
47+
run: |
48+
conan profile detect --force
49+
# create Conan package via JFrog CLI and attach build info
50+
jfrog rt conan-create . \
51+
--build missing \
52+
--user ephraim.eckl \
53+
--channel stable \
54+
--version ${{ steps.vars.outputs.version }} \
55+
--build-name=embedded-lib \
56+
--build-number=${{ github.run_number }}
57+
58+
- name: Upload Conan package
59+
run: |
60+
# upload package to Artifactory repository
61+
jfrog rt conan-upload "*" emilcode-conan \
62+
--build-name=embedded-lib \
63+
--build-number=${{ github.run_number }} \
64+
--module=embedded-lib \
65+
--force=true
66+
67+
- name: Publish build info
68+
run: |
69+
# publish metadata (build info) to Artifactory
70+
jfrog rt build-publish embedded-lib ${{ github.run_number }}

0 commit comments

Comments
 (0)