2021-03-26 14:55:53 +01:00
name : CI
on :
2021-06-23 16:43:58 +02:00
push :
pull_request :
branches :
2024-10-22 17:53:17 +02:00
- '*'
2022-09-25 22:59:01 +02:00
workflow_dispatch :
2024-10-22 17:53:17 +02:00
inputs :
version :
description : Release Version
required : false
# Builds & Uploads:
# * Linux x86_64 Portable
# * Linux App Image
# * Mac Universal Portable
# * Mac Universal DMG
# * Windows x86_64 Portable
# * Windows x86_64 Installer
2022-09-25 22:59:01 +02:00
jobs :
2024-10-22 17:53:17 +02:00
# Checks to see if we have an input, and stamps that onto the repo.
# Determines if this is a release, and determines the official ref.
version :
name : Compute Version & Check for Release
runs-on : ubuntu-latest
2021-03-26 14:55:53 +01:00
env :
2024-10-22 17:53:17 +02:00
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
outputs :
release : ${{ steps.check_release.outputs.release }}
ref : ${{ steps.check_release.outputs.ref }}
2021-03-26 14:55:53 +01:00
steps :
2024-10-22 17:53:17 +02:00
- name : Update Tag
uses : richardsimko/update-tag@v1
if : ${{ github.event.inputs.version }}
2022-09-25 22:59:01 +02:00
with :
2024-10-22 17:53:17 +02:00
tag_name : ${{ github.event.inputs.version }}
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- uses : actions/checkout@v4
2022-09-25 22:59:01 +02:00
with :
2024-10-22 17:53:17 +02:00
fetch-depth : 0
fetch-tags : true
- name : Check Release
id : check_release
run : |
export REF=`git describe --match v[0-9]* HEAD --tags`
echo "Build Version: $REF"
[ [ "$REF" != "" ]] && echo "ref=$REF" >> $GITHUB_OUTPUT
if [[ `git describe --exact-match --match v[0-9]* HEAD --tags` ]]; then
echo "release=$REF" >> $GITHUB_OUTPUT
echo "Release Version: $REF"
fi
build_darwin :
name : Darwin
needs : [ version]
2024-06-18 05:38:41 +02:00
strategy :
matrix :
config :
2024-10-22 17:53:17 +02:00
- { runner: macos-13, type: bundle, arch : x86_64-darwin }
- { runner: macos-13, type: portable, arch : x86_64-darwin }
- { runner: macos-14, type: bundle, arch : aarch64-darwin }
- { runner: macos-14, type: portable, arch : aarch64-darwin }
2024-06-18 05:38:41 +02:00
runs-on : ${{ matrix.config.runner }}
2021-08-09 12:39:03 +02:00
steps :
2022-09-25 22:59:01 +02:00
- name : System Information
run : |
system_profiler SPSoftwareDataType
bash --version
gcc -v
xcodebuild -version
2024-10-22 17:53:17 +02:00
- uses : actions/checkout@v4
2022-09-25 22:59:01 +02:00
- name : Python Setup
2024-06-07 04:08:12 +02:00
uses : actions/setup-python@v5
2024-10-22 17:53:17 +02:00
with : { python-version : "3.11" }
2022-09-25 22:59:01 +02:00
- name : Install Dependencies
2024-10-22 17:53:17 +02:00
run : scripts/install-dependencies.sh
2022-09-25 22:59:01 +02:00
- name : Build
2024-10-22 17:53:17 +02:00
run : scripts/build.sh --addons --debug --forcefallback --${{ matrix.config.type }} -b build
- name : Package Mac (Bundle)
if : ${{ matrix.config.type == 'bundle' }}
run : cd build && tar -czvf ../lite-xl-${{ needs.version.outputs.ref }}-${{ matrix.config.arch }}}-${{ matrix.config.type }}.tar.gz lite-xl Info.plist
- name : Package Mac (Portable)
if : ${{ matrix.config.type == 'portable' }}
run : cd build && tar -czvf ../lite-xl-${{ needs.version.outputs.ref }}-${{ matrix.config.arch }}}-${{ matrix.config.type }}.tar.gz lite-xl
- name : Upload (Intermediate)
2024-06-07 04:08:12 +02:00
uses : actions/upload-artifact@v4
2022-09-25 22:59:01 +02:00
with :
2024-10-22 17:53:17 +02:00
name : lite-xl-${{ needs.version.outputs.ref }}-${{ matrix.config.arch }}-${{ matrix.config.type }}
path : |
*.tar.gz
build_darwin_universal :
name : Darwin (Universal)
needs : [ version, build_darwin]
2024-06-18 05:38:41 +02:00
runs-on : macos-14
2024-10-22 17:53:17 +02:00
steps :
- uses : actions/checkout@v4
2024-06-07 04:08:12 +02:00
2024-10-22 17:53:17 +02:00
- name : Python Setup
2024-06-07 04:08:12 +02:00
uses : actions/setup-python@v5
2024-10-22 17:53:17 +02:00
with : { python-version : "3.11" }
2024-06-07 04:08:12 +02:00
2024-10-22 17:53:17 +02:00
- name : Install Dependencies
run : scripts/install-dependencies.sh
- name : Download Artifacts
2024-06-07 04:08:12 +02:00
uses : actions/download-artifact@v4
2023-04-11 17:33:34 +02:00
with :
2024-10-22 17:53:17 +02:00
pattern : '*darwin*'
2024-06-07 04:08:12 +02:00
2024-10-22 17:53:17 +02:00
- name : Create Universal Binaries
2023-04-11 17:33:34 +02:00
run : |
2024-10-22 17:53:17 +02:00
for TYPE in bundle portable; do
mkdir -p lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-$TYPE/lite-xl
cd lite-xl-${{ needs.version.outputs.ref }}-x86_64-darwin-$TYPE && tar -zxvf *.tar.gz && cd .. && cd lite-xl-${{ needs.version.outputs.ref }}-aarch64-darwin-$TYPE && tar -zxvf *.tar.gz && cd ..
cp -r lite-xl-${{ needs.version.outputs.ref }}-*-$TYPE/lite-xl/data lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-$TYPE/lite-xl
lipo -create -output lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-$TYPE/lite-xl/lite-xl lite-xl-${{ needs.version.outputs.ref }}-*-darwin-$TYPE/lite-xl/lite-xl
done
cp lite-xl-${{ needs.version.outputs.ref }}-x86_64-darwin-bundle/Info.plist lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-bundle/Info.plist
- name : Package Darwin (Universal DMG Image)
run : scripts/package-dmg.sh lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-bundle lite-xl-${{ needs.version.outputs.ref }}-universal-darwin
- name : Package Darwin (Universal Portable)
run : cd lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-portable && tar -zcvf ../lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-portable.tar.gz *
- name : Upload (Release)
2024-06-07 04:08:12 +02:00
uses : actions/upload-artifact@v4
2023-04-11 17:33:34 +02:00
with :
2024-10-22 17:53:17 +02:00
name : lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-release
path : |
*.dmg
*.tar.gz
2021-08-09 12:39:03 +02:00
2024-10-22 17:53:17 +02:00
build_linux :
name : Linux (x86_64)
needs : [ version]
runs-on : ubuntu-latest
env :
BUILDER : docker run -v .:/build -w /build ghcr.io/lite-xl/lite-xl-build-box-manylinux:v3.0.2 -- /entrypoint.sh
steps :
- uses : actions/checkout@v4
- name : Build
run : $BUILDER scripts/build.sh --addons --debug --forcefallback --portable -b build
- name : Package Linux (Portable)
run : cd build && tar -czvf ../lite-xl-${{ needs.version.outputs.ref }}-x86_64-linux-portable.tar.gz lite-xl && cd ..
- name : Package Linux (AppImage)
run : $BUILDER scripts/package-appimage.sh --debug --version ${{ needs.version.outputs.ref }} -b build
- name : Upload (Release)
uses : actions/upload-artifact@v4
with :
name : lite-xl-${{ needs.version.outputs.ref }}-x86_64-linux-portable-release
path : |
*.tar.gz
*.AppImage
build_windows :
name : Windows (x86_64) (MSYS)
2021-08-09 12:39:03 +02:00
runs-on : windows-2019
2024-10-22 17:53:17 +02:00
defaults :
2021-08-09 12:39:03 +02:00
run :
shell : msys2 {0}
2024-10-22 17:53:17 +02:00
needs : [ version]
2021-08-09 12:39:03 +02:00
steps :
2024-10-22 17:53:17 +02:00
- uses : msys2/setup-msys2@v2
with : { msystem : MINGW64 }
- uses : actions/checkout@v4
2024-06-07 04:08:12 +02:00
- name : Install Dependencies
2024-10-22 17:53:17 +02:00
run : bash scripts/install-dependencies.sh
2024-06-07 04:08:12 +02:00
- name : Build
2024-10-22 17:53:17 +02:00
run : bash scripts/build.sh -U --addons --debug --forcefallback --portable -b build
- name : Package Windows (Portable)
run : cd build && zip -r ../lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows-portable.zip lite-xl && cd ..
- name : Package Windows (InnoSetup)
run : bash scripts/package-innosetup.sh --debug --version ${{ needs.version.outputs.ref }} -b build
- name : Upload (Release)
2024-06-07 04:08:12 +02:00
uses : actions/upload-artifact@v4
with :
2024-10-22 17:53:17 +02:00
name : lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows-portable-release
path : |
*.zip
*.exe
2022-11-16 04:23:45 +01:00
build_windows_msvc :
2024-10-22 17:53:17 +02:00
name : Windows (x86_64) (MSVC)
needs : [ version]
2022-11-16 04:23:45 +01:00
runs-on : windows-2019
steps :
2024-10-22 17:53:17 +02:00
- uses : actions/checkout@v4
2024-06-07 04:08:12 +02:00
- name : Setup MSVC
uses : ilammy/msvc-dev-cmd@v1
2022-11-16 04:23:45 +01:00
with :
2024-10-22 17:53:17 +02:00
arch : x86_64
2024-06-07 04:08:12 +02:00
- name : Setup Python
uses : actions/setup-python@v5
2024-10-22 17:53:17 +02:00
with : { python-version : "3.11" }
2024-06-07 04:08:12 +02:00
2022-11-16 04:23:45 +01:00
- name : Install meson and ninja
run : pip install meson ninja
2024-06-07 04:08:12 +02:00
2022-11-16 04:23:45 +01:00
- name : Set up environment variables
run : |
2023-11-30 02:46:56 +01:00
"LUA_SUBPROJECT_PATH=subprojects/$(awk -F ' *= *' '/directory/ { printf $2 }' subprojects/lua.wrap)" >> $env:GITHUB_ENV
2024-06-07 04:08:12 +02:00
2024-10-22 17:53:17 +02:00
- name : Download subprojects
2023-10-20 03:09:51 +02:00
shell : bash
2022-11-16 04:23:45 +01:00
run : |
2023-04-07 19:25:31 +02:00
meson subprojects download
2024-06-07 04:08:12 +02:00
2023-10-20 03:09:51 +02:00
- name : Configure
2024-10-22 17:53:17 +02:00
run : meson setup --wrap-mode=forcefallback build
2024-06-07 04:08:12 +02:00
2022-11-16 04:23:45 +01:00
- name : Build
2024-10-22 17:53:17 +02:00
run : meson install -C build --destdir="../lite-xl"
2024-06-07 04:08:12 +02:00
2022-11-16 04:23:45 +01:00
- name : Package
run : |
Remove-Item -Recurse -Force -Path "lite-xl/lib","lite-xl/include"
2024-10-22 17:53:17 +02:00
Compress-Archive -Path lite-xl -DestinationPath "lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows.zip"
2024-06-07 04:08:12 +02:00
2024-10-22 17:53:17 +02:00
- name : Upload Artifacts (Intermediate)
2024-06-07 04:08:12 +02:00
uses : actions/upload-artifact@v4
2022-11-16 04:23:45 +01:00
with :
2024-10-22 17:53:17 +02:00
name : lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows (MSVC)
2024-06-07 04:08:12 +02:00
compression-level : 0
2024-10-22 17:53:17 +02:00
path : |
*.zip
release :
name : Create Release
needs : [ version, build_linux, build_windows, build_darwin_universal]
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
- name : Download Artifacts
uses : actions/download-artifact@v4
with :
pattern : lite-xl-*-release
path : .
- name : Versioned Release
uses : softprops/action-gh-release@v1
if : ${{ needs.version.outputs.release }}
with :
tag_name : ${{ needs.version.outputs.release }}
name : Lite XL ${{ needs.version.outputs.release }}
draft : true
body_path : changelog.md
generate_release_notes : true
files : |
*/*.tar.gz
*/*.zip
*/*.exe
*/*.dmg
*/*.AppImage
- name : Update Tag
uses : richardsimko/update-tag@v1
if : github.ref == 'refs/heads/master'
with :
tag_name : continuous
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Continuous Release
uses : softprops/action-gh-release@v1
if : github.ref == 'refs/heads/master'
with :
name : Lite XL Continuous Release
tag_name : continuous
prerelease : true
files : |
*/*.tar.gz
*/*.zip
*/*.exe
*/*.dmg
*/*.AppImage