Skip to content

fix build

fix build #306

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags: [ v* ]
workflow_dispatch:
jobs:
build-ubuntu:
name: Build & Package Ubuntu
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
env:
BUILD_WRAPPER_OUT_DIR: sonar_output
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo SONAR_CACHE_PATH=$HOME/$BUILD_WRAPPER_OUT_DIR >> $GITHUB_ENV
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
echo FORCE_CACHE_UPDATE=${RANDOM}${RANDOM} >> $GITHUB_ENV
- name: Sonar data cache
uses: actions/cache@v3
with:
path: ${{ env.SONAR_CACHE_PATH }}
key: ${{ runner.os }}-sonar-cache-${{ env.FORCE_CACHE_UPDATE }}
restore-keys: |
${{ runner.os }}-sonar-cache-
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Configure
run: ./configure release
- name: Build
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
- name: Build & save CI packages
run: |
make JX_VERSION=1ci REFLEX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework_1ci_*.deb jafl,libjx@web.sourceforge.net:htdocs/ci/jx-application-framework.deb
scp -o StrictHostKeyChecking=no -i sourceforge_key ../re-flex_1ci_*.deb jafl,libjx@web.sourceforge.net:htdocs/ci/re-flex.deb
rm -f ../jx-application-framework_1ci_* ../re-flex_1ci_*
build-ubuntu-release:
name: Build & Package Ubuntu Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Configure
run: ./configure release
- name: Build
run: make
- name: Build release packages
run: |
make release
mv ../jx-application-framework_* .
- name: Save release packages
uses: actions/upload-artifact@v3
with:
name: release
path: jx-application-framework_*
build-fedora:
name: Build & Package Fedora
runs-on: ubuntu-latest
container: fedora:latest
steps:
- name: Install git, zstd for actions/cache, glibc-langpack-en for LC_ALL
run: dnf install -y git zstd glibc-langpack-en
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables - after glibc-langpack-en is installed
run: |
echo LC_ALL=en_US.utf8 >> $GITHUB_ENV
echo LANG=en_US.utf8 >> $GITHUB_ENV
echo ACE_VERSION=`cat .ace-version` >> $GITHUB_ENV
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: fedora-reflex-${{ env.REFLEX_VERSION }}
- name: ACE cache
uses: actions/cache@v3
with:
path: ACE/ACE_wrappers
key: fedora-ace-${{ env.ACE_VERSION }}
- name: Configure
run: ./configure release
- name: Build
run: make
- name: Build & save CI packages
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
make JX_VERSION=1ci ACE_VERSION=1ci REFLEX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework-1ci.*.rpm jafl,libjx@web.sourceforge.net:htdocs/ci/jx-application-framework-fedora.rpm
scp -o StrictHostKeyChecking=no -i sourceforge_key ../ace-1ci.*.rpm jafl,libjx@web.sourceforge.net:htdocs/ci/ace-fedora.rpm
scp -o StrictHostKeyChecking=no -i sourceforge_key ../re-flex-1ci.*.rpm jafl,libjx@web.sourceforge.net:htdocs/ci/re-flex-fedora.rpm
rm -f ../jx-application-framework-1ci.* ../ace-1ci.* ../re-flex-1ci.*
- name: Build release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
make release
mv ../jx-application-framework_* ../jx-application-framework-* .
ls -l
- name: Save release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: release
path: |
jx-application-framework_*
jx-application-framework-*
build-macos:
name: Build & Package MacOS
runs-on: macos-13
env:
PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure
run: |
./configure release
brew install cask
brew install --cask xquartz
- name: Build
run: make
- name: Build & save CI packages
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
run: |
make JX_VERSION=1ci release
echo "${{ secrets.SOURCEFORGE_KEY }}" >> sourceforge_key
chmod 0600 sourceforge_key
scp -o StrictHostKeyChecking=no -i sourceforge_key ../jx-application-framework_1ci_*.tar.gz jafl,libjx@web.sourceforge.net:htdocs/ci/jx-application-framework_darwin.tgz
rm -f ../jx-application-framework_1ci_*
- name: Build release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
make release
mv ../jx-application-framework_* .
- name: Save release packages
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: release
path: jx-application-framework_*
release:
name: Upload releases
runs-on: ubuntu-latest
needs: [ build-ubuntu-release, build-fedora, build-macos ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/download-artifact@v3
with:
name: release
- name: Save release packages
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: jx-application-framework*
tag: ${{ github.ref }}
file_glob: true
update-homebrew:
name: Update Homebrew Formulas
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TRIGGER_BUILDS }}
repository: jafl/homebrew-jx
event-type: new-release
coverage:
name: Coverage
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set environment variables
run: |
echo REFLEX_VERSION=`cat .reflex-version` >> $GITHUB_ENV
- name: RE/flex cache
uses: actions/cache@v3
with:
path: misc/reflex
key: ${{ runner.os }}-reflex-${{ env.REFLEX_VERSION }}
- name: Configure
run: |
./configure release
- name: Build with code coverage
run: |
make coverage
- uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: true
verbose: true
build-apps:
name: Build apps
runs-on: ubuntu-latest
needs: [ build-ubuntu, build-fedora, build-macos ]
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
strategy:
matrix:
repo:
- drakon
- glove
- jx-ide
- leibnitz
- ssh-askpass
- subversion_client
- system-g
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TRIGGER_BUILDS }}
repository: jafl/${{ matrix.repo }}
event-type: new-jx