Merge pull request #464 from NikitaZotov/release/0.10.0 #13
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
tests-conan: | |
uses: ./.github/workflows/test_conan.yml | |
check-dockerfile: | |
uses: ./.github/workflows/check_dockerfile.yml | |
build-conan: | |
needs: tests-conan | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- { os: ubuntu-22.04, cc: "gcc", cxx: "g++" } | |
- { os: macos-14, cc: "clang", cxx: "clang++" } | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Restore ccache caches | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }} | |
- name: Conan cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.conan/data | |
key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }} | |
- name: apt cache | |
uses: actions/cache@v4 | |
if: runner.os == 'Linux' | |
with: | |
path: | | |
/var/cache/apt/ | |
/var/lib/apt/ | |
key: apt-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/install_deps_ubuntu.sh') }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Set up pipx | |
run: | | |
python -m pip install --user pipx | |
python -m pipx ensurepath | |
- name: Set up Conan | |
run: | | |
pipx install cmake | |
pipx install conan | |
- name: Install compilers (Ubuntu) | |
if: runner.os == 'Linux' | |
run: sudo apt install build-essential ninja-build ccache | |
- name: Install compilers (macOS) | |
if: runner.os == 'macOS' | |
run: brew install cmake ninja ccache | |
- name: Build sc-machine | |
id: run_cmake | |
run: | | |
cmake --preset release-conan | |
cmake --build --preset release | |
- name: Set Conan remote | |
run: | | |
conan remote add ostis-ai https://conan.ostis.net/artifactory/api/conan/ostis-ai-sc-machine/ | |
conan remote login ostis-ai ${{ secrets.CONAN_USERNAME }} -p ${{ secrets.CONAN_API_KEY }} | |
- name: Create Conan package | |
run: | | |
conan install . --build=missing | |
conan export-pkg . | |
- name: Upload to Conan remote | |
run: | | |
conan upload sc-machine/${{ github.ref_name }} -r ostis-ai | |
- name: Create archive | |
run: | | |
cd ./build/Release | |
cpack -G TGZ | |
- name: Upload archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sc-machine-${{ matrix.config.os }}-${{ github.ref_name }} | |
path: ./build/Release/sc-machine-*.tar.gz | |
changelog: | |
needs: build-conan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Read changelog | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ github.ref_name }} | |
path: docs/changelog.md | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: sc-machine-* | |
path: artifacts | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
name: 'v${{ github.ref_name }}' | |
files: | | |
artifacts/**/*.tar.gz | |
docker: | |
needs: check-dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ostis/sc-machine:latest,ostis/sc-machine:${{ github.ref_name }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=registry,ref=ostis/sc-machine:buildcache | |
cache-to: type=registry,ref=ostis/sc-machine:buildcache,mode=max |