Skip to content

Update build.yml

Update build.yml #52

Workflow file for this run

name: ci/gh-actions/cli
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
REMOVE_BUNDLED_BOOST : rm -rf /usr/local/share/boost
APT_INSTALL_LINUX: 'sudo apt install -y curl unzip automake build-essential file pkg-config git python3 python-is-python3 libtool libtinfo5 cmake clang ccache'
APT_SET_CONF: |
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
CCACHE_SETTINGS: |
ccache --max-size=350M
ccache --set-config=compression=true
jobs:
# build-android:
# runs-on: ubuntu-latest
# env:
# CCACHE_TEMPDIR: /tmp/.ccache-temp
# steps:
#
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-ubuntu-build-${{ github.sha }}
# restore-keys: ccache-ubuntu-build-
#
# - name: Remove bundled Boost.
# run: ${{env.REMOVE_BUNDLED_BOOST}}
#
# - name: Set apt.conf
# run: ${{env.APT_SET_CONF}}
#
# - name: Update apt.
# run: sudo apt update -y
#
# - name: Install dependencies.
# run: ${{env.APT_INSTALL_LINUX}}
#
# - name: Build.
# run: |
# ${{env.CCACHE_SETTINGS}}
# cd build_scripts/android
# ./build_all.sh
#
# - name: Create zip-arcive.
# run: |
# cd build_scripts/android
# zip -r dist-android.zip dist
#
# - uses: actions/upload-artifact@v3
# with:
# name: dist-android.zip
# path: build_scripts/android/dist-android.zip
# retention-days: 1
#
# build-macos:
# runs-on: macos-13
# env:
# CCACHE_TEMPDIR: /tmp/.ccache-temp
# steps:
#
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - uses: actions/cache@v3
# with:
# path: ~/.ccache
# key: ccache-${{ runner.os }}-build-macos-${{ github.sha }}
# restore-keys: ccache-${{ runner.os }}-build-macos-
#
# - name: install dependencies
# run: |
# HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
#
# - name: Build.
# run: |
# cd build_scripts/macos
# ./build_all.sh
#
# - name: Create zip-arcive.
# run: |
# cd build_scripts/macos
# zip -r dist-macos.zip dist
#
# - uses: actions/upload-artifact@v3
# with:
# name: dist-macos.zip
# path: build_scripts/macos/dist-macos.zip
# retention-days: 1
build-ios:
runs-on: macos-13
env:
CCACHE_TEMPDIR: /tmp/.ccache-temp
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{ runner.os }}-build-ios-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-build-ios-
- name: install dependencies
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
- name: Build.
run: |
${{env.CCACHE_SETTINGS}}
cd build_scripts/ios
./build_all.sh
- name: Create zip-arcive.
run: |
cd build_scripts/ios
zip -r dist-ios.zip dist
- uses: actions/upload-artifact@v3
with:
name: dist-ios.zip
path: build_scripts/ios/dist-ios.zip
retention-days: 1
#Release
create-release:
runs-on: ubuntu-latest
#needs: [build-android, build-macos, build-ios]
needs: [build-ios]
steps:
- name: Create release.
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
# # Android
# - name: Download Android artifact.
# uses: actions/download-artifact@v3
# with:
# name: dist-android.zip
#
# - name: Upload Android artifact.
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist-android.zip
# asset_name: dist-android.zip
# asset_content_type: application/zip
# iOS
- name: Download iOS artifact.
uses: actions/download-artifact@v3
with:
name: dist-ios.zip
- name: Upload iOS artifact.
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist-ios.zip
asset_name: dist-ios.zip
asset_content_type: application/zip
# # macOS
# - name: Download macOS artifact.
# uses: actions/download-artifact@v3
# with:
# name: dist-macos.zip
#
# - name: Upload macOS artifact.
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist-macos.zip
# asset_name: dist-macos.zip
# asset_content_type: application/zip