Skip to content

Commit

Permalink
deploy to own repo
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Jul 21, 2021
1 parent 7cc8e59 commit 033ae59
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 61 deletions.
110 changes: 62 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: ci
on: [push, pull_request]
on:
push: {branches-ignore: [latest], tags: ['*']}
pull_request:
env:
PACKAGE_NAME: ${{ github.event.repository.name }}
PACKAGE_VERSION: ${{ github.sha }}
MYCI_JFROG_USERNAME: [email protected]
MYCI_JFROG_PASSWORD: ${{ secrets.MYCI_JFROG_PASSWORD }}
MYCI_NEXUS_USERNAME: cppfw
MYCI_NEXUS_PASSWORD: ${{ secrets.MYCI_NEXUS_PASSWORD }}
MYCI_GIT_USERNAME: igagis
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }}
CONAN_REMOTE: https://cppfw.jfrog.io/artifactory/api/conan/conan
MYCI_CONAN_REMOTE: http://gagis.hopto.org/conan
MYCI_CONAN_USER: cppfw
MYCI_CONAN_PASSWORD: ${{ secrets.MYCI_CONAN_PASSWORD }}
CONAN_V2_MODE: 1
CONAN_REVISIONS_ENABLED: 1
CONAN_SCM_TO_CONANDATA: 1
jobs:
##### linux #####
linux:
Expand All @@ -19,28 +24,28 @@ jobs:
include:
- {os: debian, codename: buster, image_owner: , package_type: deb}
- {os: debian, codename: buster, image_owner: i386/, package_type: deb, labels: [i386,docker]}
# - {os: ubuntu, codename: bionic, image_owner: , package_type: deb}
- {os: debian, codename: buster, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]}
- {os: ubuntu, codename: focal, image_owner: , package_type: deb}
- {os: raspbian, codename: buster, image_owner: igagis/, package_type: deb, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
steps:
- name: git clone
uses: actions/checkout@v1
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://cppfw.jfrog.io/artifactory/${{ matrix.os }} ${{ matrix.codename }} main
repo: deb http://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
key-server: https://cppfw.jfrog.io/artifactory/api/gpg/key/public
keys: 4A949240F79AD8027C6CA2F4953AE777616ADEDF
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci git
- name: install ci tools
run: |
# configure timezone to avoid 'tzdata' package to require user interaction during installation (needed for ubuntu:focal)
TZ=Europe/Helsinki ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt install --assume-yes devscripts equivs myci
apt install --assume-yes devscripts equivs
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
Expand All @@ -51,14 +56,16 @@ jobs:
- name: build
run: dpkg-buildpackage --unsigned-source --unsigned-changes
- name: deploy deb packages
run: myci-deploy-debian-jfrog.sh --domain cppfw --repo ${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib$(cat name.txt)*_${PACKAGE_VERSION}_*.deb
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-debian-ssh-freight.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib$(cat name.txt)*_${PACKAGE_VERSION}_*.deb
if: matrix.package_type == 'deb' && startsWith(github.ref, 'refs/tags/')
##### macosx #####
macosx:
runs-on: macos-latest
steps:
- name: git clone
uses: actions/checkout@v2
uses: myci-actions/checkout@master
- name: add cppfw tap
run: |
brew tap cppfw/tap
Expand All @@ -85,7 +92,7 @@ jobs:
- name: install ci tools
run: brew install myci
- name: git clone
uses: actions/checkout@v2
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
Expand All @@ -104,24 +111,24 @@ jobs:
- name: create package
run: myci-create-zip-package.sh --headers-dir src/agg/include///agg --file xcode/build/lib$PACKAGE_NAME.a///lib/ios --file LICENSE $PACKAGE_NAME-$PACKAGE_VERSION.zip
- name: deploy
run: myci-deploy-cocoapods-jfrog.sh --repo cppfw --version $PACKAGE_VERSION --domain cppfw --jfrog-repo cocoapods --package-file $PACKAGE_NAME-$PACKAGE_VERSION.zip cocoapods/$PACKAGE_NAME.podspec.in
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
myci-deploy-cocoapods-ssh.sh --repo cppfw --version $PACKAGE_VERSION --server gagis.hopto.org --key repo_key_rsa --generic-repo cppfw/cocoapods --package $PACKAGE_NAME-$PACKAGE_VERSION.zip cocoapods/$PACKAGE_NAME.podspec.in
if: startsWith(github.ref, 'refs/tags/')
##### android #####
android:
runs-on: ubuntu-latest
container: mingc/android-build-box:latest
steps:
- name: git clone
uses: actions/checkout@v2
uses: myci-actions/checkout@master
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://cppfw.jfrog.io/artifactory/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main
repo: deb http://gagis.hopto.org/repo/cppfw/$(lsb_release --id --short | tr '[:upper:]' '[:lower:]') $(lsb_release --codename --short) main
repo-name: cppfw
key-server: https://cppfw.jfrog.io/artifactory/api/gpg/key/public
keys: 4A949240F79AD8027C6CA2F4953AE777616ADEDF
- name: install ci tools
run: apt install --assume-yes myci
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
Expand All @@ -132,7 +139,7 @@ jobs:
myci-apply-version.sh -v $PACKAGE_VERSION *.pom.in
myci-apply-version.sh -v $PACKAGE_VERSION *.aar.in --filename-only
- name: deploy
run: myci-deploy-maven-jfrog.sh --domain cppfw --repo android --path io/github/cppfw/$PACKAGE_NAME/$PACKAGE_VERSION android/$PACKAGE_NAME-$PACKAGE_VERSION.aar
run: myci-deploy-maven-nexus.sh --base-url http://gagis.hopto.org/nexus --repo android android/$PACKAGE_NAME-$PACKAGE_VERSION.aar
if: startsWith(github.ref, 'refs/tags/')
##### msys2 #####
msys2:
Expand All @@ -156,16 +163,23 @@ jobs:
install: >-
msys2-devel
mingw-w64-${{ matrix.arch }}-toolchain
- name: git clone
uses: actions/checkout@v2
- name: add cppfw pacman msys repo
uses: myci-actions/add-pacman-repo@master
with: {name: cppfw_msys, url: 'https://cppfw.jfrog.io/artifactory/msys2/msys', shell: 'msys2 {0}'}
- name: add cppfw pacman ${{ matrix.repo }} repo
with:
name: cppfw_msys
url: http://gagis.hopto.org/repo/cppfw/msys2/msys
shell: 'msys2 {0}'
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: myci
- name: add cppfw pacman msys/mingw repo
uses: myci-actions/add-pacman-repo@master
with: {name: 'cppfw_${{ matrix.repo }}', url: 'https://cppfw.jfrog.io/artifactory/msys2/${{ matrix.repo }}', shell: 'msys2 {0}'}
- name: install ci tools
run: pacman -Sy --noconfirm myci
with:
name: cppfw_${{ matrix.repo }}
url: http://gagis.hopto.org/repo/cppfw/msys2/${{ matrix.repo }}
shell: 'msys2 {0}'
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
- name: git clone
uses: myci-actions/checkout@master
- name: prepare pacman package
run: myci-apply-version.sh -v $(myci-deb-version.sh debian/changelog) msys2/PKGBUILD.in
- name: build
Expand All @@ -176,8 +190,9 @@ jobs:
PKGEXT='.pkg.tar.xz' autojobs=true makepkg-mingw --syncdeps --noconfirm --skipinteg
- name: deploy
run: |
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
for f in $(find msys2 -name "mingw-w64-${{ matrix.arch }}-$PACKAGE_NAME-*-any.pkg.*"); do
myci-deploy-pacman-jfrog.sh --domain cppfw --repo msys2 --path ${{ matrix.repo }} --database cppfw_${{ matrix.repo }} $f
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/msys2/${{ matrix.repo }} --database cppfw_${{ matrix.repo }} $f
done
if: startsWith(github.ref, 'refs/tags/')
##### msvs #####
Expand Down Expand Up @@ -213,28 +228,27 @@ jobs:
include:
- {os: debian, codename: buster, image_owner: , arch: x86_64}
# - {os: debian, codename: buster, image_owner: i386/, arch: x86, labels: [i386,docker]}
- {os: raspbian, codename: buster, image_owner: igagis/, arch: armhf, labels: [arm,docker]}
- {os: debian, codename: buster, image_owner: arm32v7/, arch: armhf, labels: [arm,docker]}
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
name: conan - linux - ${{ matrix.arch }}
steps:
- name: git clone
uses: actions/checkout@v1
- name: clean
uses: myci-actions/clean@master
- name: add cppfw deb repo
uses: myci-actions/add-deb-repo@master
with:
repo: deb https://cppfw.jfrog.io/artifactory/${{ matrix.os }} ${{ matrix.codename }} main
repo: deb http://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
repo-name: cppfw
key-server: https://cppfw.jfrog.io/artifactory/api/gpg/key/public
keys: 4A949240F79AD8027C6CA2F4953AE777616ADEDF
- name: install ci tools
run: |
apt install --assume-yes devscripts equivs myci prorab prorab-extra python3-pip cmake
key-server: http://gagis.hopto.org/repo/cppfw/pubkey.gpg
install: devscripts equivs myci prorab prorab-extra python3-pip cmake git
- name: install conan
run: |
pip3 install conan
conan profile new --detect default
conan profile update settings.compiler.libcxx=libstdc++11 default
- name: git clone
uses: myci-actions/checkout@master
- name: set PACKAGE_VERSION
uses: myci-actions/export-env-var@master
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
Expand All @@ -243,20 +257,20 @@ jobs:
run: myci-apply-version.sh -v $PACKAGE_VERSION conan/conanfile.py.in
- name: build
run: |
conan remote add cppfw $CONAN_REMOTE
conan create conan
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create conan $MYCI_CONAN_USER/main --ignore-dirty
- name: deploy conan package
run: |
conan user --remote cppfw --password $MYCI_JFROG_PASSWORD $MYCI_JFROG_USERNAME
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@
conan user --remote cppfw --password $MYCI_CONAN_PASSWORD $MYCI_CONAN_USER
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')
##### conan - macosx #####
conan-macosx:
name: conan - macosx
runs-on: macos-latest
steps:
- name: git clone
uses: actions/checkout@v2
uses: myci-actions/checkout@master
- name: add cppfw tap
run: |
brew tap cppfw/tap
Expand All @@ -276,10 +290,10 @@ jobs:
run: myci-apply-version.sh -v $PACKAGE_VERSION conan/conanfile.py.in
- name: build
run: |
conan remote add cppfw $CONAN_REMOTE
conan create conan
conan remote add cppfw $MYCI_CONAN_REMOTE
conan create conan $MYCI_CONAN_USER/main --ignore-dirty
- name: deploy conan package
run: |
conan user --remote cppfw --password $MYCI_JFROG_PASSWORD $MYCI_JFROG_USERNAME
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@
conan user --remote cppfw --password $MYCI_CONAN_PASSWORD $MYCI_CONAN_USER
conan upload --remote cppfw --all $PACKAGE_NAME/$PACKAGE_VERSION@$MYCI_CONAN_USER/main
if: startsWith(github.ref, 'refs/tags/')
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/out/*
2 changes: 1 addition & 1 deletion cocoapods/agg.podspec.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.platform = :ios
s.ios.deployment_target = '8.0'

s.source = { :http => "https://cppfw.jfrog.io/artifactory/cocoapods/#{s.name}-#{s.version}.zip" }
s.source = { :http => "http://gagis.hopto.org/repo/cppfw/cocoapods/#{s.name}-#{s.version}.zip" }

s.source_files = "include/**/*.{hpp,h}"
s.header_mappings_dir = "include"
Expand Down
26 changes: 14 additions & 12 deletions conan/conanfile.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ class AggConan(ConanFile):
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
generators = "make"
scm = {"type": "git", "url": "auto", "revision": "auto"}

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def source(self):
self.run("git clone https://github.com/cppfw/" + self.name + ".git")
self.run("cd " + self.name + " && git checkout " + self.version)
# we use the 'scm' attribute, so the source() method is not needed
# def source(self):
# self.run("git clone https://github.com/cppfw/" + self.name + ".git")
# self.run("cd " + self.name + " && git checkout " + self.version)

# This small hack might be useful to guarantee proper /MT /MD linkage
# in MSVC if the packaged project doesn't have variables to set it
Expand All @@ -30,18 +32,18 @@ class AggConan(ConanFile):
# conan_basic_setup()''')

def build(self):
self.run("CONANBUILDINFO_DIR=$(pwd)/ make --directory " + self.name + " autojobs=true")
self.run("CONANBUILDINFO_DIR=$(pwd)/ make --directory " + self.name + " autojobs=true test")
self.run("CONANBUILDINFO_DIR=$(pwd)/ make autojobs=true")
self.run("CONANBUILDINFO_DIR=$(pwd)/ make autojobs=true test")

def package(self):
self.copy("*.h", dst="include/agg", src=self.name + "/src/agg/include")
self.copy("*.hpp", dst="include/agg", src=self.name + "/src/agg/include")
self.copy("*.h", dst="include", src="src")
self.copy("*.hpp", dst="include", src="src")
self.copy("*" + self.name + ".lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", src=self.name + "/src/build", keep_path=False)
self.copy("*.so", dst="lib", src=self.name + "/src/build", keep_path=False)
self.copy("*.so.*", dst="lib", src=self.name + "/src/build", keep_path=False)
self.copy("*.dylib", dst="lib", src=self.name + "/src/build", keep_path=False)
self.copy("*.a", dst="lib", src=self.name + "/src/build", keep_path=False)
self.copy("*.dll", dst="bin", src= "src/out/rel", keep_path=False)
self.copy("*.so", dst="lib", src= "src/out/rel", keep_path=False)
self.copy("*.so.*", dst="lib", src= "src/out/rel", keep_path=False)
self.copy("*.dylib", dst="lib", src="src/out/rel", keep_path=False)
self.copy("*.a", dst="lib", src= "src/out/rel", keep_path=False)

def package_info(self):
self.cpp_info.libs = ["antigrain"]

0 comments on commit 033ae59

Please sign in to comment.