first try #106
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: Build Linux | |
on: | |
push: | |
paths: | |
- 'linux/**' | |
- '.github/workflows/linux.yml' | |
- 'versions.conf' | |
release: | |
types: | |
- published | |
jobs: | |
linux_build: | |
runs-on: ubuntu-22.04 | |
if: github.repository == 'merginmaps/input-sdk' | |
env: | |
ARCH: 'linux-x86_64' | |
UBUNTU_VERSION: 2204 | |
QT_VERSION: '6.5.0' | |
CACHE_VERSION: 0 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check deps versions change | |
run: | | |
CHECKSUM=$( md5sum versions.conf | cut -d ' ' -f1 ) | |
echo "DEPS_CHECKSUM=$CHECKSUM" >> $GITHUB_ENV | |
- name: Prepare build cache for branch/tag | |
# use a fork of actions/cache@v2 to upload cache even when the build or test failed | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${{ github.workspace }}/build | |
# The branch or tag ref that triggered the workflow run. For branches this in the format refs/heads/<branch_name>, and for tags it is refs/tags/<tag_name> | |
key: cache-${{ env.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.UBUNTU_VERSION }}-${{ github.ref }}-${{ github.sha }} | |
restore-keys: | | |
cache-${{ env.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.UBUNTU_VERSION }}-${{ github.ref }}- | |
cache-${{ env.DEPS_CHECKSUM }}-v${{ env.CACHE_VERSION }}-${{ env.UBUNTU_VERSION }}-refs/heads/master- | |
- name: Install Build Dependencies | |
run: | | |
echo "Versions checksum: ${{ env.DEPS_CHECKSUM }}" | |
sudo apt-get install -y bison ca-certificates ccache cmake cmake-curses-gui dh-python expect flex flip \ | |
git graphviz libexiv2-dev libexpat1-dev libfcgi-dev libgeos-dev \ | |
libgsl-dev libfreexl-dev libpq-dev libprotobuf-dev \ | |
libspatialindex-dev libsqlite3-dev libyaml-tiny-perl \ | |
libzip-dev libzstd-dev lighttpd locales ninja-build \ | |
pkg-config poppler-utils protobuf-compiler python3-all-dev \ | |
spawn-fcgi xauth xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xvfb | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ env.QT_VERSION }} | |
setup-python: 'false' | |
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools' | |
dir: ${{ github.workspace }} | |
cache: true | |
cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-lnx | |
- name: Export config.conf | |
run: | | |
touch ./linux/config.conf | |
echo -e "export ROOT_OUT_PATH=${{ github.workspace }}/build" >> ./linux/config.conf | |
echo -e "export ARCHES=("\""${{ env.ARCH }}"\"")" >> ./linux/config.conf | |
cat ./linux/config.conf | |
- name: Build Sdk | |
run: | | |
./linux/distribute.sh -mqgis | |
- name: Get TimeStamp | |
id: time | |
uses: nanzm/get-time-action@v1.1 | |
with: | |
timeZone: 8 | |
format: 'YYYYMMDD' | |
- name: Create package | |
run: | | |
SDK_TAR=input-sdk-ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.tar.gz | |
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV | |
cd "${{ github.workspace }}/build/stage/${{ env.ARCH }}" | |
tar -c -z -f ${{ github.workspace }}/${SDK_TAR} ./ | |
- name: Upload Sdk in Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ${{ github.workspace }}/${{ env.SDK_TAR }} | |
- name: Create Release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ubuntu-${{ env.UBUNTU_VERSION }}-${{ steps.time.outputs.time }}-${{ github.run_number }} | |
allowUpdates: true | |
artifacts: ${{ env.SDK_TAR }} | |
token: ${{ secrets.GITHUB_TOKEN }} |