name: Release on: push: tags: - v[0-9]+.* workflow_dispatch: inputs: version: description: Release Version default: v2.1.6 required: true jobs: release: name: Create Release runs-on: ubuntu-latest permissions: contents: write outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} version: ${{ steps.tag.outputs.version }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Fetch Version id: tag run: | if [[ "${{ github.event.inputs.version }}" != "" ]]; then echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT else echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT fi - name: Update Tag uses: richardsimko/update-tag@v1 with: tag_name: ${{ steps.tag.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Generate Release Notes env: GH_TOKEN: ${{ github.token }} run: bash scripts/generate-release-notes.sh --debug --version ${{ steps.tag.outputs.version }} - name: Create Release id: create_release uses: ncipollo/release-action@v1 with: name: Lite XL ${{ steps.tag.outputs.version }} tag: ${{ steps.tag.outputs.version }} draft: true bodyFile: release-notes.md allowUpdates: true build_linux: name: Linux needs: release runs-on: ubuntu-latest steps: - name: Set Environment Variables run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV" echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV - name: Checkout code uses: actions/checkout@v4 # disabled because this will break our own Python install - name: Python Setup if: false uses: actions/setup-python@v5 with: python-version: "3.11" # disabled because the container has up-to-date packages - name: Update Packages if: false run: sudo apt-get update # disabled as the dependencies are already installed - name: Install Dependencies if: false run: | bash scripts/install-dependencies.sh --debug sudo apt-get install -y ccache - name: Build Portable uses: docker://ghcr.io/lite-xl/lite-xl-build-box-manylinux:v3 with: entrypoint: /entrypoint.sh args: | bash --version bash scripts/build.sh --debug --forcefallback --portable --release - name: Package Portables uses: docker://ghcr.io/lite-xl/lite-xl-build-box-manylinux:v3 with: entrypoint: /entrypoint.sh args: | bash scripts/package.sh --version ${INSTALL_REF} --debug --binary --release bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --binary --release - name: Build AppImages uses: docker://ghcr.io/lite-xl/lite-xl-build-box-manylinux:v3 with: entrypoint: /entrypoint.sh args: | bash scripts/appimage.sh --debug --static --version ${INSTALL_REF} --release bash scripts/appimage.sh --debug --nobuild --addons --version ${INSTALL_REF} - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: Linux Artifacts path: | lite-xl-${{ env.INSTALL_REF }}-linux-x86_64-portable.tar.gz lite-xl-${{ env.INSTALL_REF }}-addons-linux-x86_64-portable.tar.gz LiteXL-${{ env.INSTALL_REF }}-x86_64.AppImage LiteXL-${{ env.INSTALL_REF }}-addons-x86_64.AppImage build_macos: name: macOS needs: release strategy: matrix: config: - { arch: x86_64, runner: macos-13 } # macos-13 uses x86_64 - { arch: arm64, runner: macos-14 } # macos-14 / latest uses M1 runs-on: ${{ matrix.config.runner }} env: CC: clang CXX: clang++ steps: - name: System Information run: | system_profiler SPSoftwareDataType bash --version gcc -v xcodebuild -version - name: Set Environment Variables run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV" echo "INSTALL_NAME=lite-xl-${{ needs.release.outputs.version }}-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV" echo "INSTALL_NAME_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-macos-${{ matrix.config.arch }}" >> "$GITHUB_ENV" - name: Checkout code uses: actions/checkout@v4 - name: Python Setup uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install Dependencies run: | brew install bash md5sha1sum pip install meson ninja dmgbuild - name: Build run: | bash --version bash scripts/build.sh --bundle --debug --forcefallback --release - name: Create DMG Image run: | bash scripts/package.sh --version ${INSTALL_REF} --debug --dmg --release bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --dmg --release - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: macOS DMG Images (${{ matrix.config.arch }}) path: | ${{ env.INSTALL_NAME }}.dmg ${{ env.INSTALL_NAME_ADDONS }}.dmg build_macos_universal: name: macOS (Universal) needs: [release, build_macos] runs-on: macos-14 steps: - name: System Information run: | system_profiler SPSoftwareDataType bash --version gcc -v xcodebuild -version - name: Set Environment Variables run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "INSTALL_BASE=lite-xl-${{ needs.release.outputs.version }}-macos" >> "$GITHUB_ENV" echo "INSTALL_BASE_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-macos" >> "$GITHUB_ENV" - uses: actions/checkout@v4 - name: Download Artifacts uses: actions/download-artifact@v4 id: download with: pattern: macOS DMG Images * merge-multiple: true path: dmgs-original - name: Python Setup uses: actions/setup-python@v5 with: python-version: "3.11" - name: Install dmgbuild run: pip install dmgbuild - name: Prepare DMG Images run: | mkdir -p dmgs-addons dmgs-normal mv -v "${{ steps.download.outputs.download-path }}/$INSTALL_BASE-"{x86_64,arm64}.dmg dmgs-normal mv -v "${{ steps.download.outputs.download-path }}/$INSTALL_BASE_ADDONS-"{x86_64,arm64}.dmg dmgs-addons - name: Create Universal DMGs run: | bash --version bash scripts/make-universal-binaries.sh dmgs-normal "$INSTALL_BASE-universal" bash scripts/make-universal-binaries.sh dmgs-addons "$INSTALL_BASE_ADDONS-universal" - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: macOS DMG Images (Universal) path: | ${{ env.INSTALL_BASE }}-universal.dmg ${{ env.INSTALL_BASE_ADDONS }}-universal.dmg build_windows_msys2: name: Windows needs: release runs-on: windows-2019 strategy: matrix: config: - { msystem: MINGW32, arch: i686 } - { msystem: MINGW64, arch: x86_64 } defaults: run: shell: msys2 {0} steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup MSYS2 uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.config.msystem }} update: true install: >- base-devel git zip unzip mingw-w64-${{ matrix.config.arch }}-gcc mingw-w64-${{ matrix.config.arch }}-meson mingw-w64-${{ matrix.config.arch }}-ninja mingw-w64-${{ matrix.config.arch }}-ca-certificates mingw-w64-${{ matrix.config.arch }}-ntldd - name: Set Environment Variables run: | echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV" if [[ "${MSYSTEM}" == "MINGW64" ]]; then echo "INSTALL_NAME=lite-xl-${{ needs.release.outputs.version }}-windows-x86_64" >> "$GITHUB_ENV" echo "INSTALL_NAME_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-windows-x86_64" >> "$GITHUB_ENV" else echo "INSTALL_NAME=lite-xl-${{ needs.release.outputs.version }}-windows-i686" >> "$GITHUB_ENV" echo "INSTALL_NAME_ADDONS=lite-xl-${{ needs.release.outputs.version }}-addons-windows-i686" >> "$GITHUB_ENV" fi - name: Install Dependencies if: false run: bash scripts/install-dependencies.sh --debug - name: Build run: | bash --version bash scripts/build.sh -U --debug --forcefallback --release - name: Package run: bash scripts/package.sh --version ${INSTALL_REF} --debug --binary --release - name: Build Installer run: bash scripts/innosetup/innosetup.sh --debug --version ${INSTALL_REF} - name: Package With Addons run: bash scripts/package.sh --version ${INSTALL_REF} --debug --addons --binary --release - name: Build Installer With Addons run: bash scripts/innosetup/innosetup.sh --debug --version ${INSTALL_REF} --addons - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: Windows Builds (${{ matrix.config.msystem }}) path: | ${{ env.INSTALL_NAME }}.zip ${{ env.INSTALL_NAME_ADDONS }}.zip LiteXL-${{ env.INSTALL_REF }}-${{ matrix.config.arch }}-setup.exe LiteXL-${{ env.INSTALL_REF }}-addons-${{ matrix.config.arch }}-setup.exe upload_artifacts: name: Upload Release Artifacts runs-on: ubuntu-latest needs: [release, build_linux, build_macos, build_macos_universal, build_windows_msys2] permissions: contents: write steps: - name: Download Artifacts uses: actions/download-artifact@v4 with: merge-multiple: true - name: Update Release uses: ncipollo/release-action@v1 with: tag: ${{ needs.release.outputs.version }} omitBodyDuringUpdate: true omitDraftDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true allowUpdates: true artifacts: "*.exe,*.zip,*.tar.gz,*.dmg,*.AppImage"