lite-xl/.github/workflows/build.yml

253 lines
7.6 KiB
YAML
Raw Normal View History

name: CI
# All builds use lhelper only for releases,
# otherwise for normal builds dependencies are dynamically linked.
on:
2021-06-23 16:43:58 +02:00
push:
branches:
2021-08-09 12:39:03 +02:00
- '*'
# tags:
# - 'v[0-9]*'
2021-06-23 16:43:58 +02:00
pull_request:
branches:
2021-08-09 12:39:03 +02:00
- '*'
jobs:
2021-08-09 12:39:03 +02:00
archive_source_code:
name: Source Code Tarball
runs-on: ubuntu-18.04
# Only on tags/releases
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- name: Python Setup
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install Dependencies
run: |
sudo apt-get install -qq ninja-build
pip3 install meson
- name: Package
2021-08-09 12:39:03 +02:00
shell: bash
run: bash scripts/package.sh --version ${GITHUB_REF##*/} --debug --source
2021-08-09 12:39:03 +02:00
- uses: actions/upload-artifact@v2
with:
name: Source Code Tarball
path: "lite-xl-*-src.tar.gz"
2021-08-09 12:39:03 +02:00
build_linux:
name: Linux
runs-on: ubuntu-18.04
strategy:
matrix:
config:
- { name: "GCC", cc: gcc, cxx: g++ }
- { name: "clang", cc: clang, cxx: clang++ }
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
steps:
- name: Set Environment Variables
2021-08-09 12:39:03 +02:00
if: ${{ matrix.config.cc == 'gcc' }}
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
2021-08-09 12:39:03 +02:00
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-linux-$(uname -m)" >> "$GITHUB_ENV"
2021-08-09 12:39:03 +02:00
- uses: actions/checkout@v2
- name: Python Setup
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Update Packages
run: sudo apt-get update
- name: Install Dependencies
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/install-dependencies.sh --debug
- name: Install Release Dependencies
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
bash scripts/install-dependencies.sh --debug --lhelper
bash scripts/lhelper.sh --debug
2021-08-09 12:39:03 +02:00
- name: Build
run: |
bash --version
bash scripts/build.sh --debug --forcefallback
2021-08-09 12:39:03 +02:00
- name: Package
if: ${{ matrix.config.cc == 'gcc' }}
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --binary
2021-08-09 12:39:03 +02:00
- name: AppImage
if: ${{ matrix.config.cc == 'gcc' && startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/appimage.sh --nobuild --version ${INSTALL_REF}
2021-08-09 12:39:03 +02:00
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: ${{ matrix.config.cc == 'gcc' }}
with:
name: Linux Artifacts
path: |
${{ env.INSTALL_NAME }}.tar.gz
LiteXL-${{ env.INSTALL_REF }}-x86_64.AppImage
2021-08-09 12:39:03 +02:00
build_macos:
name: macOS (x86_64)
runs-on: macos-10.15
2021-08-09 12:39:03 +02:00
env:
CC: clang
CXX: clang++
steps:
- name: System Information
run: |
system_profiler SPSoftwareDataType
bash --version
2021-08-09 12:39:03 +02:00
gcc -v
xcodebuild -version
- name: Set Environment Variables
2021-08-09 12:39:03 +02:00
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-macos-$(uname -m)" >> "$GITHUB_ENV"
2021-08-09 12:39:03 +02:00
- uses: actions/checkout@v2
- name: Python Setup
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/install-dependencies.sh --debug
- name: Install Release Dependencies
2021-08-09 12:39:03 +02:00
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
bash scripts/install-dependencies.sh --debug --lhelper
bash scripts/lhelper.sh --debug
2021-08-09 12:39:03 +02:00
- name: Build
run: |
bash --version
bash scripts/build.sh --bundle --debug --forcefallback
2021-08-09 12:39:03 +02:00
- name: Error Logs
if: failure()
run: |
mkdir ${INSTALL_NAME}
cp /usr/var/lhenv/lite-xl/logs/* ${INSTALL_NAME}
tar czvf ${INSTALL_NAME}.tar.gz ${INSTALL_NAME}
# - name: Package
# if: ${{ !startsWith(github.ref, 'refs/tags/') }}
# run: bash scripts/package.sh --version ${INSTALL_REF} --debug --addons
2021-08-09 12:39:03 +02:00
- name: Create DMG Image
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --dmg
2021-08-09 12:39:03 +02:00
- name: Upload DMG Image
uses: actions/upload-artifact@v2
with:
name: macOS DMG Image
path: ${{ env.INSTALL_NAME }}.dmg
- name: Upload Error Logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: Error Logs
path: ${{ env.INSTALL_NAME }}.tar.gz
build_windows_msys2:
name: Windows
runs-on: windows-2019
strategy:
matrix:
2021-08-09 12:39:03 +02:00
msystem: [MINGW32, MINGW64]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
#msystem: MINGW64
msystem: ${{ matrix.msystem }}
update: true
install: >-
base-devel
git
zip
- name: Set Environment Variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "INSTALL_NAME=lite-xl-${GITHUB_REF##*/}-windows-$(uname -m)" >> "$GITHUB_ENV"
echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
2021-08-09 12:39:03 +02:00
- name: Install Dependencies
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/install-dependencies.sh --debug
2021-08-09 12:39:03 +02:00
- name: Install Release Dependencies
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/install-dependencies.sh --debug --lhelper
2021-08-09 12:39:03 +02:00
- name: Build
run: |
bash --version
bash scripts/build.sh --debug --forcefallback
2021-08-09 12:39:03 +02:00
- name: Error Logs
if: failure()
run: |
mkdir ${INSTALL_NAME}
cp /usr/var/lhenv/lite-xl/logs/* ${INSTALL_NAME}
tar czvf ${INSTALL_NAME}.tar.gz ${INSTALL_NAME}
- name: Package
run: bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --binary
2021-08-09 12:39:03 +02:00
- name: Build Installer
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: bash scripts/innosetup/innosetup.sh --debug
2021-08-09 12:39:03 +02:00
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Windows Artifacts
path: |
LiteXL*.exe
${{ env.INSTALL_NAME }}.zip
- name: Upload Error Logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: Error Logs
path: ${{ env.INSTALL_NAME }}.tar.gz
deploy:
name: Deployment
runs-on: ubuntu-18.04
# if: startsWith(github.ref, 'refs/tags/')
2021-08-09 12:39:03 +02:00
if: false
needs:
- archive_source_code
- build_linux
- build_macos
- build_windows_msys2
steps:
2021-08-09 12:39:03 +02:00
- name: Set Environment Variables
run: echo "INSTALL_REF=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v2
with:
name: Linux Artifacts
- uses: actions/download-artifact@v2
with:
name: macOS DMG Image
- uses: actions/download-artifact@v2
with:
name: Source Code Tarball
- uses: actions/download-artifact@v2
with:
name: Windows Artifacts
- name: Display File Information
shell: bash
run: ls -lR
# Note: not using `actions/create-release@v1`
# because it cannot update an existing release
# see https://github.com/actions/create-release/issues/29
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.INSTALL_REF }}
name: Release ${{ env.INSTALL_REF }}
draft: false
prerelease: false
files: |
lite-xl-${{ env.INSTALL_REF }}-*
LiteXL*.AppImage
LiteXL*.exe