Skip to content

Commit 823ce2c

Browse files
committed
publishing packages
1 parent 136c9e7 commit 823ce2c

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.github/conan-upload/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM conanio/gcc8
2+
3+
LABEL "com.github.actions.name"="conan-upload"
4+
LABEL "com.github.actions.description"="Uploads a Conan package"
5+
6+
LABEL "maintainer"="Dmitry Arkhipov <grisumbras@gmail.com>"
7+
8+
USER root
9+
ADD entrypoint.sh /entrypoint.sh
10+
ENTRYPOINT ["/entrypoint.sh"]

.github/conan-upload/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh -l
2+
3+
eval "$(pyenv init -)"
4+
eval "$(pyenv virtualenv-init -)"
5+
conan user -p $CONAN_PASSWORD -r upload_repo $CONAN_LOGIN_USERNAME
6+
7+
PACKAGE_NAME=$(conan inspect . -a name | cut -d\ -f2)
8+
PACKAGE_VERSION=$(conan inspect . -a version | cut -d\ -f2)
9+
CONAN_REFERENCE=$PACKAGE_NAME/$PACKAGE_VERSION
10+
11+
conan upload -r upload_repo -c $CONAN_REFERENCE

.github/main.workflow

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
workflow "CI" {
22
on = "push"
3-
resolves = "build"
3+
resolves = "publish"
44
}
55

66

@@ -24,3 +24,16 @@ action "build" {
2424
CONAN_USERNAME = "grisumbras"
2525
}
2626
}
27+
28+
29+
action "filter-ref" {
30+
needs = "build"
31+
uses = "actions/bin/filter@master"
32+
args = "branch master || tag"
33+
}
34+
35+
action "publish" {
36+
uses = "./.github/conan-upload/"
37+
needs = "filter-ref"
38+
secrets = ["CONAN_LOGIN_USERNAME", "CONAN_PASSWORD"]
39+
}

0 commit comments

Comments
 (0)