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

300 lines
9.9 KiB
YAML
Raw Normal View History

name: CI
on:
2021-06-23 16:43:58 +02:00
push:
pull_request:
branches:
- '*'
workflow_dispatch:
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
jobs:
# 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
release: ${{ steps.check_release.outputs.release }}
ref: ${{ steps.check_release.outputs.ref }}
steps:
- name: Update Tag
uses: richardsimko/update-tag@v1
if: ${{ github.event.inputs.version }}
with:
tag_name: ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
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]
strategy:
matrix:
config:
- { 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 }
runs-on: ${{ matrix.config.runner }}
2021-08-09 12:39:03 +02:00
steps:
- name: System Information
run: |
system_profiler SPSoftwareDataType
bash --version
gcc -v
xcodebuild -version
- uses: actions/checkout@v4
- name: Python Setup
uses: actions/setup-python@v5
with: { python-version: "3.11" }
- name: Install Dependencies
run: scripts/install-dependencies.sh
- name: Build
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)
uses: actions/upload-artifact@v4
with:
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]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Python Setup
uses: actions/setup-python@v5
with: { python-version: "3.11" }
- name: Install Dependencies
run: scripts/install-dependencies.sh
- name: Download Artifacts
uses: actions/download-artifact@v4
Cross compiling improvements + macOS universal binary (#1458) * chore(resources): rename macos_arm64.txt to macos-arm64.txt This matches the platform-arch convention like many other parts of the project. * chore(resources/cross): rename wasm.txt to unknown-wasm32.txt * refactor(scripts/common.sh): use parameter expansion instead of if else * feat(scripts/common.sh): support custom arch and platform for get_default_build_dir * feat(scripts/build.sh): add --cross-platform, --cross-arch and --cross-file * feat(scripts/package.sh): add --cross-platform and --cross-arch * feat(build-packages.sh): add support for new options in build.sh and packages.sh * ci(build): make arm64 binaries in CI * ci(build): do not install external libraries * ci(build): fix invalid artifact name * ci(build): fix INSTALL_NAME * ci(build): change name for macos artifacts * ci(build): add script to build universal dmgs from individual dmgs * ci(build): build universal dmgs * fix(make-universal-binaries): fix wrong path for hdiutil * ci(build): rename macos action * fix(make-universal-binaries.sh): fix wrong pathname for ditto * ci(release): build macos universal binaries * ci(release): remove useless variables * ci(release): fix wrong dependency * ci(build): fix old ubuntu version This version will be restored once I complete some container-specific fixes. * ci(build): make build_macos_universal depend on release * ci(build): fix wrong dmg dir * style(ci): capitalize 'universal' for CI name * fix(make-universal-binaries.sh): fix truncated dmg name when it contains dots * ci: styling changes * ci(release): install appdmg only
2023-04-11 17:33:34 +02:00
with:
pattern: '*darwin*'
- name: Create Universal Binaries
Cross compiling improvements + macOS universal binary (#1458) * chore(resources): rename macos_arm64.txt to macos-arm64.txt This matches the platform-arch convention like many other parts of the project. * chore(resources/cross): rename wasm.txt to unknown-wasm32.txt * refactor(scripts/common.sh): use parameter expansion instead of if else * feat(scripts/common.sh): support custom arch and platform for get_default_build_dir * feat(scripts/build.sh): add --cross-platform, --cross-arch and --cross-file * feat(scripts/package.sh): add --cross-platform and --cross-arch * feat(build-packages.sh): add support for new options in build.sh and packages.sh * ci(build): make arm64 binaries in CI * ci(build): do not install external libraries * ci(build): fix invalid artifact name * ci(build): fix INSTALL_NAME * ci(build): change name for macos artifacts * ci(build): add script to build universal dmgs from individual dmgs * ci(build): build universal dmgs * fix(make-universal-binaries): fix wrong path for hdiutil * ci(build): rename macos action * fix(make-universal-binaries.sh): fix wrong pathname for ditto * ci(release): build macos universal binaries * ci(release): remove useless variables * ci(release): fix wrong dependency * ci(build): fix old ubuntu version This version will be restored once I complete some container-specific fixes. * ci(build): make build_macos_universal depend on release * ci(build): fix wrong dmg dir * style(ci): capitalize 'universal' for CI name * fix(make-universal-binaries.sh): fix truncated dmg name when it contains dots * ci: styling changes * ci(release): install appdmg only
2023-04-11 17:33:34 +02:00
run: |
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)
uses: actions/upload-artifact@v4
Cross compiling improvements + macOS universal binary (#1458) * chore(resources): rename macos_arm64.txt to macos-arm64.txt This matches the platform-arch convention like many other parts of the project. * chore(resources/cross): rename wasm.txt to unknown-wasm32.txt * refactor(scripts/common.sh): use parameter expansion instead of if else * feat(scripts/common.sh): support custom arch and platform for get_default_build_dir * feat(scripts/build.sh): add --cross-platform, --cross-arch and --cross-file * feat(scripts/package.sh): add --cross-platform and --cross-arch * feat(build-packages.sh): add support for new options in build.sh and packages.sh * ci(build): make arm64 binaries in CI * ci(build): do not install external libraries * ci(build): fix invalid artifact name * ci(build): fix INSTALL_NAME * ci(build): change name for macos artifacts * ci(build): add script to build universal dmgs from individual dmgs * ci(build): build universal dmgs * fix(make-universal-binaries): fix wrong path for hdiutil * ci(build): rename macos action * fix(make-universal-binaries.sh): fix wrong pathname for ditto * ci(release): build macos universal binaries * ci(release): remove useless variables * ci(release): fix wrong dependency * ci(build): fix old ubuntu version This version will be restored once I complete some container-specific fixes. * ci(build): make build_macos_universal depend on release * ci(build): fix wrong dmg dir * style(ci): capitalize 'universal' for CI name * fix(make-universal-binaries.sh): fix truncated dmg name when it contains dots * ci: styling changes * ci(release): install appdmg only
2023-04-11 17:33:34 +02:00
with:
name: lite-xl-${{ needs.version.outputs.ref }}-universal-darwin-release
path: |
*.dmg
*.tar.gz
2021-08-09 12:39:03 +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
defaults:
2021-08-09 12:39:03 +02:00
run:
shell: msys2 {0}
needs: [version]
2021-08-09 12:39:03 +02:00
steps:
- uses: msys2/setup-msys2@v2
with: { msystem: MINGW64 }
- uses: actions/checkout@v4
- name: Install Dependencies
run: bash scripts/install-dependencies.sh
- name: Build
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)
uses: actions/upload-artifact@v4
with:
name: lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows-portable-release
path: |
*.zip
*.exe
build_windows_msvc:
name: Windows (x86_64) (MSVC)
needs: [version]
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86_64
- name: Setup Python
uses: actions/setup-python@v5
with: { python-version: "3.11" }
- name: Install meson and ninja
run: pip install meson ninja
- name: Set up environment variables
run: |
"LUA_SUBPROJECT_PATH=subprojects/$(awk -F ' *= *' '/directory/ { printf $2 }' subprojects/lua.wrap)" >> $env:GITHUB_ENV
- name: Download subprojects
shell: bash
run: |
meson subprojects download
- name: Configure
run: meson setup --wrap-mode=forcefallback build
- name: Build
run: meson install -C build --destdir="../lite-xl"
- name: Package
run: |
Remove-Item -Recurse -Force -Path "lite-xl/lib","lite-xl/include"
Compress-Archive -Path lite-xl -DestinationPath "lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows.zip"
- name: Upload Artifacts (Intermediate)
uses: actions/upload-artifact@v4
with:
name: lite-xl-${{ needs.version.outputs.ref }}-x86_64-windows (MSVC)
compression-level: 0
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