📦 Pack and publish 9dbdc6cf535fd5bb6b22de0a9b5d71f47821b851 #884
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 📦 Pack and publish | |
run-name: 📦 Pack and publish ${{ github.sha }} | |
#on: workflow_call | |
on: | |
workflow_run: | |
workflows: [ 🔬 Test ] | |
types: [ completed ] | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
types: [opened, synchronize, reopened, labeled, unlabeled] | |
push: | |
branches: | |
- columnar-* | |
# cancels the previous workflow run when a new one appears in the same branch (e.g. master or a PR's branch) | |
concurrency: | |
group: pack_${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pack: | |
name: OK to pack? | |
runs-on: ubuntu-22.04 | |
if: | | |
(github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'pack') || contains(github.event.pull_request.labels.*.name, 'publish'))) | |
|| (github.event_name == 'push') | |
|| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/master' && github.event.workflow_run.event != 'schedule') | |
steps: | |
- run: echo "All set to build packages" | |
pack_debian_ubuntu: | |
uses: ./.github/workflows/build_template.yml | |
needs: pack | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTR: [bionic, focal, jammy, buster, bullseye, bookworm] | |
arch: [x86_64, aarch64] | |
name: ${{ matrix.DISTR }} ${{ matrix.arch }} packing | |
with: | |
DISTR: ${{ matrix.DISTR }} | |
arch: ${{ matrix.arch }} | |
cmake_command: | | |
mkdir build | |
cd build | |
cmake -DPACK=1 .. | |
cmake --build . --target package | |
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }} | |
artifact_list: "build/manticore*deb" | |
pack_rhel: | |
uses: ./.github/workflows/build_template.yml | |
needs: pack | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTR: [rhel7, rhel8, rhel9] | |
arch: [x86_64, aarch64] | |
name: ${{ matrix.DISTR }} ${{ matrix.arch }} packing | |
with: | |
DISTR: ${{ matrix.DISTR }} | |
arch: ${{ matrix.arch }} | |
boost: boost_rhel_feb17 | |
cmake_command: | | |
ln -s $(pwd) /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0 | |
cd /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0 | |
mkdir build | |
cd build | |
cmake -DPACK=1 .. | |
cmake --build . --target package | |
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }} | |
artifact_list: "build/manticore*rpm" | |
pack_macos: | |
uses: ./.github/workflows/build_template.yml | |
needs: pack | |
strategy: | |
fail-fast: false | |
matrix: | |
DISTR: [macos] | |
arch: [x86_64, arm64] | |
name: ${{ matrix.DISTR }} ${{ matrix.arch }} packing | |
with: | |
DISTR: ${{ matrix.DISTR }} | |
arch: ${{ matrix.arch }} | |
HOMEBREW_PREFIX: /opt/homebrew | |
cmake_command: | | |
mkdir build | |
cd build | |
cmake -DPACK=1 .. | |
cmake --build . --target package | |
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }} | |
artifact_list: "build/manticore*tar.gz" | |
pack_windows: | |
name: Windows x64 package | |
uses: ./.github/workflows/build_template.yml | |
needs: pack | |
with: | |
DISTR: windows | |
arch: x64 | |
cmake_command: | | |
mkdir build | |
cd build | |
cmake -DPACK=1 .. | |
cmake --build . --target package | |
cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }} | |
artifact_list: "build/manticore*exe build/manticore*zip" | |
# virtual job to simplify the CI | |
# This job depends on all the package preparation jobs that have to pass before we can start publishing packages | |
publish: | |
name: OK to publish? | |
runs-on: ubuntu-22.04 | |
needs: [pack_debian_ubuntu, pack_rhel, pack_macos, pack_windows] | |
if: | | |
(github.repository == 'manticoresoftware/columnar') | |
&& ( | |
(github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'publish'))) | |
|| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
|| (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/columnar-')) | |
) | |
steps: | |
- run: echo "Ready to publish" | |
publish_debian_ubuntu: | |
needs: publish | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
DISTR: [bionic, focal, jammy, buster, bullseye, bookworm] | |
arch: [x86_64, aarch64] | |
name: ${{ matrix.DISTR }} ${{ matrix.arch }} publishing | |
steps: | |
- uses: manticoresoftware/publish_to_repo@main | |
with: | |
ssh_key: ${{ secrets.REPO_SSH_KEY }} | |
distr: ${{ matrix.DISTR }} | |
arch: ${{ matrix.arch }} | |
artifact: build_${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }} | |
type: deb | |
delimiter: "-" | |
publish_rhel: | |
needs: publish | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
DISTR: [7, 8, 9] | |
arch: [x86_64, aarch64] | |
name: RHEL ${{ matrix.DISTR }} ${{ matrix.arch }} publishing | |
steps: | |
- uses: manticoresoftware/publish_to_repo@main | |
with: | |
ssh_key: ${{ secrets.REPO_SSH_KEY }} | |
distr: ${{ matrix.DISTR }} | |
arch: ${{ matrix.arch }} | |
artifact: build_rhel${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }} | |
type: rpm | |
delimiter: "_" | |
publish_macos: | |
needs: publish | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
arch: [x86_64, arm64] | |
name: macos ${{ matrix.arch }} publishing | |
steps: | |
- uses: manticoresoftware/publish_to_repo@main | |
with: | |
ssh_key: ${{ secrets.REPO_SSH_KEY }} | |
distr: macos | |
arch: ${{ matrix.arch }} | |
artifact: build_macos_RelWithDebInfo_${{ matrix.arch }} | |
type: arc | |
delimiter: "-" | |
publish_windows: | |
name: Publishing Windows packages to repo.manticoresearch.com | |
needs: publish | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: manticoresoftware/publish_to_repo@main | |
with: | |
ssh_key: ${{ secrets.REPO_SSH_KEY }} | |
distr: windows | |
arch: x64 | |
artifact: build_windows_RelWithDebInfo_x64 | |
type: arc | |
delimiter: "-" | |
vars: | |
name: Detecting versions | |
needs: | |
- publish_debian_ubuntu | |
- publish_rhel | |
- publish_macos | |
- publish_windows | |
runs-on: ubuntu-22.04 | |
outputs: | |
app_version: ${{ steps.vars.outputs.app_version }} | |
app_date: ${{ steps.vars.outputs.app_date }} | |
app_commit: ${{ steps.vars.outputs.app_commit }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: vars | |
run: | | |
version=$( cat CMakeLists.txt | grep 'columnar VERSION' | cut -d' ' -f5 ) | |
date=$( git log -1 --date=format-local:"%y%m%d%H" --format=%cd ) | |
commit=${GITHUB_SHA:0:7} | |
echo "app_version=$version" >> $GITHUB_OUTPUT | |
echo "app_date=$date" >> $GITHUB_OUTPUT | |
echo "app_commit=$commit" >> $GITHUB_OUTPUT | |
update-manticoresearch-deps: | |
needs: | |
- vars | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Update deps | |
uses: manticoresoftware/manticoresearch/actions/update-deps@master | |
with: | |
name: mcl | |
version: "${{ needs.vars.outputs.app_version }} ${{ needs.vars.outputs.app_date }} ${{ needs.vars.outputs.app_commit }}" | |
token: ${{ secrets.PR_TOKEN }} |