Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically deploy packages for Ubuntu and macOS #676

Merged
merged 1 commit into from
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI macOS

on: [pull_request]

jobs:
test:
name: LLVM ${{ matrix.LLVM_VERSION }}
runs-on: macOS-latest
strategy:
matrix:
LLVM_VERSION: ["3.9", "4.0", "5.0", "6.0", "7.0", "8.0", "9.0"]

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
env | sort
grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '
grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`.`grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '`
- name: Run CI task
run: |
pip install ansible
cd infrastructure && \
ansible-playbook macos-playbook.yaml \
-e llvm_version="${{ matrix.LLVM_VERSION }}.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e SDKROOT=`xcrun -show-sdk-path` \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package (macOS)
if: matrix.LLVM_VERSION == '9.0'
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/macos/mull-nightly/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.zip \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/content/mull-project/macos/mull-nightly/${{ steps.version.outputs.version }}/`cat infrastructure/PACKAGE_FILE_NAME`.zip;publish=1"
47 changes: 47 additions & 0 deletions .github/workflows/ci-ubuntu-16.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI Ubuntu 16.04

on: [pull_request]

jobs:
test:
name: LLVM 8.0.0
runs-on: ubuntu-latest
container: ubuntu:16.04

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
env | sort
grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '
grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`.`grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '`
- name: Install software
run: |
apt-get update && apt-get install -y python-pip curl
pip install ansible
- name: Run CI task
run: |
cd infrastructure && \
ansible-playbook ubuntu-playbook.yaml \
-e llvm_version="8.0.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/ubuntu-16/mull-nightly/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.deb \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
-H "X-Bintray-Debian-Distribution: nightly" \
-H "X-Bintray-Debian-Component: main" \
-H "X-Bintray-Debian-Architecture: amd64" \
"https://api.bintray.com/content/mull-project/ubuntu-16/mull-nightly/${{ steps.version.outputs.version }}/pool/main/m/`cat infrastructure/PACKAGE_FILE_NAME`.deb;publish=1"
55 changes: 55 additions & 0 deletions .github/workflows/ci-ubuntu-18.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI Ubuntu 18.04

on: [pull_request]

jobs:
test:
name: LLVM ${{ matrix.LLVM_VERSION }}
runs-on: ubuntu-latest
container: ubuntu:18.04
strategy:
matrix:
LLVM_VERSION: ["3.9", "4.0", "5.0", "6.0", "7.0", "8.0", "9.0"]

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
env | sort
grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '
grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`.`grep -Eo "\"number\": [0-9]+" $GITHUB_EVENT_PATH | awk ' { print $2; exit } '`
- name: Install software
run: |
apt-get update && apt-get install -y python-pip curl
pip install ansible
- name: Patch 3.9/4.0
if: matrix.LLVM_VERSION == '3.9' || matrix.LLVM_VERSION == '4.0'
run: |
ln -s /usr/include/locale.h /usr/include/xlocale.h
- name: Run CI task
run: |
cd infrastructure && \
ansible-playbook ubuntu-playbook.yaml \
-e llvm_version="${{ matrix.LLVM_VERSION }}.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package
if: matrix.LLVM_VERSION == '9.0'
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/ubuntu-18/mull-nightly/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.deb \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
-H "X-Bintray-Debian-Distribution: nightly" \
-H "X-Bintray-Debian-Component: main" \
-H "X-Bintray-Debian-Architecture: amd64" \
"https://api.bintray.com/content/mull-project/ubuntu-18/mull-nightly/${{ steps.version.outputs.version }}/pool/main/m/`cat infrastructure/PACKAGE_FILE_NAME`.deb;publish=1"
44 changes: 0 additions & 44 deletions .github/workflows/ci.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/release-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release macOS

on:
release:
types:
- created

jobs:
test:
name: Release macOS Package
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
if [ `echo $GITHUB_REF | awk -F/ ' { print $3 } '` != `grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '` ];
then
false
fi
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`
- name: Install software
run: |
apt-get update && apt-get install -y python-pip curl
pip install ansible
- name: Run CI task
run: |
pip install ansible
cd infrastructure && \
ansible-playbook macos-playbook.yaml \
-e llvm_version="9.0.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e SDKROOT=`xcrun -show-sdk-path` \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/macos/mull/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.zip \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/content/mull-project/macos/mull/${{ steps.version.outputs.version }}/`cat infrastructure/PACKAGE_FILE_NAME`.zip;publish=1"
51 changes: 51 additions & 0 deletions .github/workflows/release-ubuntu-16.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release Ubuntu 16.04

on:
release:
types:
- created

jobs:
test:
name: Release Ubuntu Package
runs-on: ubuntu-latest
container: ubuntu:16.04

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
if [ `echo $GITHUB_REF | awk -F/ ' { print $3 } '` != `grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '` ];
then
false
fi
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`
- name: Install software
run: |
apt-get update && apt-get install -y python-pip curl
pip install ansible
- name: Run CI task
run: |
cd infrastructure && \
ansible-playbook ubuntu-playbook.yaml \
-e llvm_version="8.0.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/ubuntu-16/mull/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.deb \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
-H "X-Bintray-Debian-Distribution: nightly" \
-H "X-Bintray-Debian-Component: main" \
-H "X-Bintray-Debian-Architecture: amd64" \
"https://api.bintray.com/content/mull-project/ubuntu-16/mull/${{ steps.version.outputs.version }}/pool/main/m/`cat infrastructure/PACKAGE_FILE_NAME`.deb;publish=1"
51 changes: 51 additions & 0 deletions .github/workflows/release-ubuntu-18.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release Ubuntu 18.04

on:
release:
types:
- created

jobs:
test:
name: Release Ubuntu Package
runs-on: ubuntu-latest
container: ubuntu:18.04

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Detect Mull version
id: version
run: |
if [ `echo $GITHUB_REF | awk -F/ ' { print $3 } '` != `grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '` ];
then
false
fi
echo ::set-output name=version::`grep -Eo "MULL_VERSION [0-9.]+" CMakeLists.txt | awk ' { print $2 } '`
- name: Install software
run: |
apt-get update && apt-get install -y python-pip curl
pip install ansible
- name: Run CI task
run: |
cd infrastructure && \
ansible-playbook ubuntu-playbook.yaml \
-e llvm_version="9.0.0" \
-e source_dir=$PWD/.. \
-e gitref=$GITHUB_SHA \
-e host=localhost \
-e mull_version=${{ steps.version.outputs.version }} \
--verbose
- name: Publish package
run: |
curl --silent --show-error --location --request DELETE \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
"https://api.bintray.com/packages/mull-project/ubuntu-18/mull/versions/${{ steps.version.outputs.version }}"
curl --silent --show-error --fail --location --request PUT \
--upload-file infrastructure/packages/`cat infrastructure/PACKAGE_FILE_NAME`.deb \
--user "alexdenisov:${{ secrets.BINTRAY_API_KEY }}" \
-H "X-Bintray-Debian-Distribution: nightly" \
-H "X-Bintray-Debian-Component: main" \
-H "X-Bintray-Debian-Architecture: amd64" \
"https://api.bintray.com/content/mull-project/ubuntu-18/mull/${{ steps.version.outputs.version }}/pool/main/m/`cat infrastructure/PACKAGE_FILE_NAME`.deb;publish=1"
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.7.0)

if (NOT MULL_VERSION)
set (MULL_VERSION 0.6.1)
endif()

project(Mull
VERSION ${MULL_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion cmake/cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else()
endif()

if (${CPACK_SYSTEM_NAME} STREQUAL "macOS")
include(cmake/packaging/cpack.PKG-macOS.cmake)
include(cmake/packaging/cpack.ZIP-macOS.cmake)
elseif (${CPACK_SYSTEM_NAME} STREQUAL "debian")
include(cmake/packaging/cpack.DEB-debian.cmake)
elseif(${CPACK_SYSTEM_NAME} STREQUAL "ubuntu")
Expand Down
2 changes: 1 addition & 1 deletion cmake/packaging/cpack.DEB-ubuntu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set (CPACK_GENERATOR DEB)
set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
set (CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})

set (CPACK_DEBIAN_PACKAGE_DEPENDS "libz-dev, libsqlite3-dev, ncurses-dev, libstdc++6, libxml2-dev, uuid-dev")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "zlib1g, libncurses5, libstdc++6, libxml2, libsqlite3-0")
1 change: 1 addition & 0 deletions cmake/packaging/cpack.ZIP-macOS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set (CPACK_GENERATOR "ZIP")
Loading