Skip to content

Use QRawFont to drawing text #1679

Use QRawFont to drawing text

Use QRawFont to drawing text #1679

Workflow file for this run

name: CI
on: [push, pull_request]
env:
cache-version: v12
jobs:
#################################################################
# Linux
#################################################################
test-and-build-linux:
strategy:
matrix:
go-version: [1.21.x]
platform: [ubuntu-20.04]
qtversion: [5.15.6]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}/Qt
QT_VERSION: ${{ matrix.qtversion }}
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QT_STATIC: true
QT_QMAKE_DIR: ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64/bin
steps:
- name: Linux prerequisites
run: |
sudo apt update
sudo apt-get -y install build-essential libglu1-mesa-dev libpulse-dev libglib2.0-dev cmake
sudo apt-get --no-install-recommends -qq -y install fontconfig libasound2 libegl1-mesa libnss3 libpci3 libxcomposite1 libxcursor1 libxi6 libxrandr2 libxtst6
sudo apt-get --no-install-recommends -qq -y install libdbus-1-dev libssl-dev libzstd-dev
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get install libwayland-dev libwayland-egl++ wayland-scanner++
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/cache@v2
id: cache-qt-linux
with:
path: ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64
key: ${{ matrix.qtversion }}-qt-linux-${{ env.cache-version }}
- name: Build Qt
if: ${{ steps.cache-qt-linux.outputs.cache-hit != 'true' }}
run: |
curl -L -o qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz https://download.qt.io/official_releases/qt/5.15/${{ matrix.qtversion }}/single/qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
tar Jxf qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
rm qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
mv qt-everywhere-src-${{ matrix.qtversion }} qt5
ls -l ${{ github.workspace }}/qt5
cd ${{ github.workspace }}/qt5 && ./configure -prefix ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64 -no-icu -confirm-license -opensource -static -qt-zlib -qt-libpng -qt-libjpeg -xcb -xcb-xlib -bundled-xcb-xinput -sysconfdir /etc/xdg -dbus-runtime -openssl-runtime -opengl -optimize-size -skip qtwebengine -skip qtfeedback -skip qtpim -feature-wayland-client -nomake tests -nomake examples && make -j $(grep -c ^processor /proc/cpuinfo) && make install -j $(grep -c ^processor /proc/cpuinfo)
rm -fr ${{ github.workspace }}/qt5
- name: Build fcitx5
env:
FILE: ${{ github.workspace }}/fcitx-qt5/qt5/platforminputcontext/CMakeLists.txt
CMAKE_PREFIX_PATH: ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64/lib/cmake
Qt5_DIR: ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64/lib/cmake/Qt5
run: |
git clone -q --depth 1 https:/fcitx/fcitx-qt5.git
echo -e "ADD_DEFINITIONS(-DQT_STATICPLUGIN)\n$(cat $FILE)" > $FILE
echo -e "find_package(Qt5 REQUIRED COMPONENTS Core Gui DBus)\n$(cat $FILE)" > $FILE
echo -e "$(head -n -5 $FILE)" > $FILE
sed -i -e 's/ MODULE / STATIC /g' $FILE
cd fcitx-qt5/qt5/platforminputcontext && cmake . && make -j $(grep -c ^processor /proc/cpuinfo)
- name: Copy libfcitxplatforminputcontextplugin.a
run: |
cp -p ${{ github.workspace }}/fcitx-qt5/qt5/platforminputcontext/libfcitxplatforminputcontextplugin.a ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64/plugins/platforminputcontexts/
rm -fr ${{ github.workspace }}/fcitx-qt5
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
sudo rm -rf /usr/share/dotnet
- name: Get Qt binding for Go
env:
Qt5_DIR: ${{ github.workspace }}/Qt/${{ matrix.qtversion }}/gcc_64/lib/cmake/Qt5
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make qt_bindings
- name: Get dependencies
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Test
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make test
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make app
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv linux goneovim-linux
tar -jcvf goneovim-linux.tar.bz2 goneovim-linux
- name: Upload for linux
uses: actions/upload-artifact@v1
with:
name: goneovim-linux
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-linux.tar.bz2
#################################################################
# MacOS
#################################################################
test-and-build-macos-x86_64:
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-12]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_HOMEBREW: true
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QT_QMAKE_DIR: /usr/local/opt/qt@5/bin
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check Go Version
run: |
go version
- name: Install Qt for macOS
run: |
brew install qt@5
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Get Qt binding for Go
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make qt_bindings
- name: Get dependencies
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Test
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make test
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make app
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin goneovim-macos-x86_64
tar -jcvf goneovim-macos-x86_64.tar.bz2 goneovim-macos-x86_64
- name: Upload for macos
uses: actions/upload-artifact@v1
with:
name: goneovim-macos-x86_64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos-x86_64.tar.bz2
#################################################################
# MacOS M1
#################################################################
test-and-build-macos-arm64:
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-14]
qtversion: [5.15.12]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_HOMEBREW: false
QT_API: 5.13.0
QT_VERSION: 5.15.12
QT_DIR: ${{ github.workspace }}/Qt
QT_STATIC: true
QT_DEBUG: false
GO111MODULE: on
QT_QMAKE_DIR: ${{ github.workspace }}/Qt/bin
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check Go Version
run: |
go version
# - name: Install Qt for macOS
# run: |
# brew install qt@5
# - uses: actions/cache@v2
# id: cache-qt-src
# with:
# path: ${{ github.workspace }}/qt5
# key: ${{ matrix.qtversion }}-qt-src-macos-${{ env.cache-version }}
# - name: Download Qt src
# if: ${{ steps.cache-qt-src.outputs.cache-hit != 'true' }}
# run: |
# curl -L -o qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz https://download.qt.io/official_releases/qt/5.15/${{ matrix.qtversion }}/single/qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
# tar Jxf qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
# rm qt-everywhere-opensource-src-${{ matrix.qtversion }}.tar.xz
# mv qt-everywhere-src-${{ matrix.qtversion }} qt5
# - uses: actions/cache@v2
# id: cache-qt-macos
# with:
# path: ${{ github.workspace }}/Qt
# key: ${{ matrix.qtversion }}-qt-macos-${{ env.cache-version }}
# - name: Build Qt
# if: ${{ steps.cache-qt-macos.outputs.cache-hit != 'true' }}
# run: |
# cd ${{ github.workspace }}/qt5/qtbase
# curl -L "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=cdf64b0e47115cc473e1afd1472b4b09e130b2a5" -o cdf64b0.diff
# patch -p1 < ./cdf64b0.diff
# cd ..
# ./configure -static -release -prefix ${{ github.workspace }}/Qt -platform macx-clang -skip qt3d -skip qtandroidextras -skip qtwayland -skip webengine -skip qtwinextras -skip qtx11extras -nomake tests -nomake examples -opensource -confirm-license -c++std c++17
# sudo make -j 3
# echo "!make done"
# sudo make install -j 3
# echo "!make install done"
# rm -fr ${{ github.workspace }}/qt5
- name: Download pre built Qt
run: |
curl -L -o qt-macos-static-5.15.12.tar.bz2 https:/akiyosi/qt-static-builds/releases/download/macOS-arm64/qt-macos-static-5.15.12.tar.bz2
tar xf qt-macos-static-5.15.12.tar.bz2
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
- name: Get Qt binding for Go
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make qt_bindings
- name: Get dependencies
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Test
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make test
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make app
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin goneovim-macos-arm64
tar -jcvf goneovim-macos-arm64.tar.bz2 goneovim-macos-arm64
- name: Upload for macos m1
uses: actions/upload-artifact@v1
with:
name: goneovim-macos-arm64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos-arm64.tar.bz2
#################################################################
# Windows
#################################################################
test-windows-mingw:
strategy:
matrix:
go-version: [1.21.0]
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_DIR: ${{ github.workspace }}\Qt
QT_API: 5.13.0
QT_MSYS2: true
QT_MSYS2_DIR: D:\a\_temp\msys64\
QT_MSVC: false
QT_DEBUG: false
GO111MODULE: on
CGO_CFLAGS_ALLOW: ".*"
CGO_CXXFLAGS_ALLOW: ".*"
CGO_LDFLAGS_ALLOW: ".*"
# CGO_ENABLED: 1
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Setup MSYS2 and install Qt5
uses: msys2/setup-msys2@v2
with:
update: true
msystem: mingw64
install: mingw-w64-x86_64-toolchain
- shell: msys2 {0}
run: |
pacman --noconfirm -S sed git make mingw-w64-x86_64-toolchain mingw-w64-x86_64-qt5
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ env.GOPATH }}\src\github.com\${{ github.repository }}
- name: Get Qt binding for Go
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
cd /d/a/goneovim/goneovim/src/github.com/${{ github.repository }}
go get -v github.com/akiyosi/qt
go get github.com/akiyosi/qt/internal/[email protected]
go get github.com/akiyosi/qt/internal/binding/files/docs/5.12.0
go get github.com/akiyosi/qt/internal/binding/files/docs/5.13.0
go get github.com/akiyosi/qt/internal/cmd/[email protected]
go install -v -tags=no_env github.com/akiyosi/qt/cmd/...
go mod vendor
git clone https:/akiyosi/env_windows_amd64_513.git vendor/github.com/akiyosi/env_windows_amd64_513
- uses: actions/cache@v2
id: cache-qt-bindings-windows-test
with:
path: |
${{ github.workspace }}\src\github.com\${{ github.repository }}\vendor\github.com\akiyosi\qt\*
!${{ github.workspace }}\src\github.com\${{ github.repository }}\vendor\github.com\akiyosi\qt\.git
key: cache-qtbindings-windows-test-${{ env.cache-version }}
- name: Generate Qt bindings
if: ${{ steps.cache-qt-bindings-windows-test.outputs.cache-hit != 'true' }}
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
cd /d/a/goneovim/goneovim/src/github.com/${{ github.repository }}
$(go env GOPATH)/bin/qtsetup -test=false
- name: Get dependencies
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
export GOPATH=/d/a/goneovim/goneovim
cd /d/a/goneovim/goneovim/src/github.com/${{ github.repository }}
make deps
- name: Test
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
export GOPATH=/d/a/goneovim/goneovim
cd /d/a/goneovim/goneovim/src/github.com/${{ github.repository }}
make test
build-windows-mingw:
strategy:
matrix:
go-version: [1.21.0]
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
env:
GOPATH: C:\
QT_API: 5.13.0
QT_MSYS2: true
QT_MSYS2_DIR: D:\a\_temp\msys64\
QT_MSYS2_STATIC: true
QT_MSVC: false
QT_DEBUG_CONSOLE: true
QT_DEBUG: false
GO111MODULE: on
CGO_CFLAGS_ALLOW: ".*"
CGO_CXXFLAGS_ALLOW: ".*"
CGO_LDFLAGS_ALLOW: ".*"
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Setup MSYS2 and install Qt5
uses: msys2/setup-msys2@v2
with:
update: true
msystem: mingw64
install: mingw-w64-x86_64-toolchain
- shell: msys2 {0}
run: |
pacman --noconfirm -S sed git make unzip zip mingw-w64-x86_64-qt-creator
pacman -Scc
pacman -Sc
curl -sL --retry 10 --retry-delay 60 -O https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-qt5-static-5.15.13-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-qt5-static-5.15.13-1-any.pkg.tar.zst
#- name: Patch qt5
# shell: msys2 {0}
# run: |
# curl -sL --retry 10 --retry-delay 60 -O https:/akiyosi/github-actions-playground/releases/download/qt-5.15.8/qt-5.15.8.zip
# unzip qt-5.15.8.zip
# cp -fpR qt5/* /mingw64/qt5-static/
# rm -fr qt5
# rm qt-5.15.8.zip
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ github.workspace }}\${{ github.repository }}
- name: Copy checkout repogitory
shell: msys2 {0}
run: |
mkdir -p /c/${{ github.repository }}
ls -l /d/a/goneovim/goneovim/${{ github.repository }}
cp -pR /d/a/goneovim/goneovim/${{ github.repository }}/* /c/${{ github.repository }}/
cp -pR /d/a/goneovim/goneovim/${{ github.repository }}/.* /c/${{ github.repository }}/
mkdir -p /c/src/github.com/${{ github.repository }}
cp -pR /d/a/goneovim/goneovim/${{ github.repository }}/* /c/src/github.com/${{ github.repository }}/
ls -l /c/${{ github.repository }}
ls -l /c/src/github.com/${{ github.repository }}
- name: Get Qt binding for Go
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
cd /c/${{ github.repository }}
make qt_bindings
- name: Get dependencies
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
cd /c/${{ github.repository }}
make deps
### https:/therecipe/qt/issues/657
#- name: Test
# shell: msys2 {0}
# run: |
# export PATH=/c/hostedtoolcache/windows/go/1.18.10/x64/bin/:$PATH
# cd /c/${{ github.repository }}
# make test
- name: Build
shell: msys2 {0}
run: |
export PATH=/c/hostedtoolcache/windows/go/${{ matrix.go-version }}/x64/bin/:$PATH
cd /c/${{ github.repository }}
make app
- name: Archive
shell: msys2 {0}
run: |
cd /c/${{ github.repository }}/cmd/goneovim/deploy
mv windows goneovim-windows
zip -r goneovim-windows.zip goneovim-windows
- name: Upload for windows
uses: actions/upload-artifact@v1
with:
name: goneovim-windows
path: C:/${{ github.repository }}/cmd/goneovim/deploy/goneovim-windows.zip
# test-and-build-windows-msvc:
# if: ${{ false }}
# strategy:
# matrix:
# platform: [windows-latest]
# qtversion: [5.14.1]
# runs-on: ${{ matrix.platform }}
# env:
# GOPATH: ${{ github.workspace }}
# GOROOT: ${{ github.workspace }}\go-root
# GOROOT_BOOTSTRAP: ${{ github.workspace }}\go-boot
# GOROOT_FINAL: ${{ github.workspace }}\go-boot
# GOVSVARSPATH: ${{ github.workspace }}\BuildTools\VC\Auxiliary\Build\vcvars64.bat
# MSVCDIR: 14.16.27023
# VSBUILDTOOLS_URL: https://aka.ms/vs/15/release/vs_buildtools.exe
# #VSBUILDTOOLS_URL: https://aka.ms/vs/17/release/vs_buildtools.exe
# QTARCH: msvc2017_64
# #QTARCH: msvc2019_64
# QT_VERSION: ${{ matrix.qtversion }}
# QT_DIR: C:\Qt
# QT_MSVC: true
# QT_DEBUG: false
# GO111MODULE: off
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# #QT5BIN: qt5_static_binaries_win.zip
# QT5BIN: qt5_shared_binaries_win.zip
# steps:
# - name: Install Qt
# uses: jurplel/install-qt-action@v3
# with:
# version: ${{ matrix.qtversion }}
# host: windows
# target: desktop
# modules: 'qtcharts qtdatavis3d qtpurchasing qtvirtualkeyboard qtnetworkauth qtwebglplugin qtscript'
# arch: 'win64_${{ env.QTARCH }}'
# install-deps: 'true'
# dir: C:\
# # mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
# #- name: Check dir
# # continue-on-error: true
# # run: |
# # dir C:\Qt
# # dir C:\Qt\${{ matrix.qtversion }}
# # dir C:\Qt\${{ matrix.qtversion }}\${{ env.QTARCH }}
# - uses: actions/cache@v2
# id: cache-msvc-buildtools
# with:
# path: ${{ github.workspace }}\BuildTools
# key: ${{ matrix.qtversion }}-msvc-buildtools-${{ env.cache-version }}
# - name: Intall MSVC Visual C++ Buildtools
# if: ${{ steps.cache-msvc-buildtools.outputs.cache-hit != 'true' }}
# run: |
# curl -sL --retry 10 --retry-delay 60 -O ${{ env.VSBUILDTOOLS_URL }}
# New-Item -Path BuildTools -ItemType Directory
# .\vs_BuildTools.exe --quiet --wait --norestart --nocache --installPath ${{ github.workspace }}\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --includeOptional
# Start-Sleep -s 660
# - name: Check MSVC Visual C++ Buildtools installation
# run: |
# dir ${{ github.workspace }}\
# dir ${{ github.workspace }}\BuildTools
# dir ${{ github.workspace }}\BuildTools\VC
# dir ${{ github.workspace }}\BuildTools\VC\Tools
# dir ${{ github.workspace }}\BuildTools\VC\Tools\MSVC
# dir ${{ github.workspace }}\BuildTools\VC\Tools\MSVC\${{ env.MSVCDIR }}
# dir ${{ github.workspace }}\BuildTools\VC\Tools\MSVC\${{ env.MSVCDIR }}\bin
# dir ${{ github.workspace }}\BuildTools\VC\Tools\MSVC\${{ env.MSVCDIR }}\bin\Hostx64
# dir ${{ github.workspace }}\BuildTools\VC\Tools\MSVC\${{ env.MSVCDIR }}\bin\Hostx64\x64
# - name: Replace qt5
# run: |
# mkdir C:\qt-dl
# cd C:\qt-dl
# curl -sL --retry 10 --retry-delay 60 -O -L https:/akiyosi/github-actions-playground/releases/download/qt5-static-msvc/${{ env.QT5BIN }}
# 7z x ${{ env.QT5BIN }}
# del ${{ env.QT5BIN }}
# Remove-Item -Path C:\Qt\${{ matrix.qtversion }}\${{ env.QTARCH }} -Force -Recurse
# Copy-Item .\qt5-bin -destination C:\Qt\${{ matrix.qtversion }}\${{ env.QTARCH }} -recurse
# Remove-Item -Path C:\qt-dl\qt5-bin -Force -Recurse
# - name: Install Go 1.18 for "go get"
# run: |
# curl -sL --retry 10 --retry-delay 60 -O https://dl.google.com/go/go1.18.5.windows-amd64.zip
# expand-archive -path go1.18.5.windows-amd64.zip -destinationpath .
# Move-Item -Path go -Destination go-1.18
# - name: Get Qt binding for Go
# env:
# GOROOT: ${{ github.workspace }}\go-1.18
# run: |
# ${{ github.workspace }}\go-1.18\bin\go.exe get -v -tags=no_env github.com/akiyosi/qt/cmd/...
# - name: Install Go 1.13
# run: |
# curl -sL --retry 10 --retry-delay 60 -O https://dl.google.com/go/go1.13.4.windows-amd64.zip
# expand-archive -path go1.13.4.windows-amd64.zip -destinationpath .
# Move-Item -Path go -Destination go-root
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# path: ${{ env.GOPATH }}\src\github.com\${{ github.repository }}
# # FIXME: Should be fixed with the deprecation of set-env
# - name: Set PATH
# run: |
# $env:PATH = "${{ github.workspace }}\\go-root\\bin;$env:PATH"
# $env:PATH = "C:\\Qt\\${{ matrix.qtversion }}\\msvc2017_64\\bin;${{ github.workspace }}\\BuildTools\\VC\\Tools\\MSVC\\${{ env.MSVCDIR }}\\bin\\Hostx64\\x64;$env:PATH"
# echo "::set-env name=PATH::$env:PATH"
# - name: Enable experimental Go features Step.1
# continue-on-error: true
# run: |
# git clone https:/golang/go.git ${{ github.workspace }}\go-msvc
# cd ${{ github.workspace }}\go-msvc
# git fetch "https://go.googlesource.com/go" refs/changes/46/133946/5
# Git checkout FETCH_HEAD
# echo "devel +6741b7009d" > VERSION
# - name: Enable experimental Go features Step.2
# continue-on-error: true
# run: |
# cd ${{ github.workspace }}\go-msvc
# curl -sL --retry 10 --retry-delay 60 https:/golang/go/commit/e4535772ca3f11084ee5fa4d4bd3a542e143b80f.patch | patch -p1 -R
# - name: Enable experimental Go features Step.3
# continue-on-error: true
# run: |
# cd ${{ github.workspace }}\go-msvc
# curl -sL --retry 10 --retry-delay 60 https:/golang/go/commit/f10815898c0732e2e6cdb697d6f95f33f8650b4e.patch | patch -p1 -R
# - name: Enable experimental Go features Step.4
# continue-on-error: true
# run: |
# cd ${{ github.workspace }}
# Move-Item -Path go-root -Destination go-boot
# Move-Item -Path go-msvc -Destination go-root
# cd ${{ github.workspace }}\go-root\src
# .\make.bat
# # - uses: actions/cache@v2
# # id: cache-qt-bindings-windows
# # with:
# # path: |
# # ${{ github.workspace }}\src\github.com\akiyosi\qt\*
# # !${{ github.workspace }}\src\github.com\akiyosi\qt\.git
# # key: ${{ matrix.qtversion }}-qtbindings-windows-${{ env.cache-version }}
# - name: Generate Qt bindings
# continue-on-error: true
# env:
# QT_API: 5.13.0
# shell: cmd
# run: |
# ${{ github.workspace }}\bin\qtsetup.exe prep windows
# ${{ github.workspace }}\bin\qtsetup.exe check windows
# ${{ github.workspace }}\bin\qtsetup.exe generate windows
# sed -i '9,14d' ${{ github.workspace }}\src\github.com\akiyosi\qt\core\core.cpp
# sed -i '661,666d' ${{ github.workspace }}\src\github.com\akiyosi\qt\internal\binding\templater\template_cpp.go
# ${{ github.workspace }}\bin\qtsetup.exe install windows
#
# - name: Get dependencies
# run: |
# go get -v -d github.com/${{ github.repository }}/...
# cd ${{ github.workspace }}\src\github.com\${{ github.repository }}
# ${{ github.workspace }}\bin\qtmoc.exe desktop ./cmd/goneovim
# # - name: Convert to compatible sources on Qt5.12
# # if: ${{ matrix.qtversion == '5.12.6' }}
# # run: |
# # cd ${{ github.workspace }}\src\github.com\${{ github.repository }}
# # $data=Get-Content .\editor\workspace.go | % { $_ -replace "NewQVariant31", "NewQVariant33" }
# # $data | Out-File .\editor\workspace.go -Encoding UTF8
# # $data=Get-Content .\editor\popupmenu.go | % { $_ -replace "AddWidget2", "AddWidget" }
# # $data | Out-File .\editor\popupmenu.go -Encoding UTF8
# # $data=Get-Content .\editor\message.go | % { $_ -replace "AddWidget2", "AddWidget" }
# # $data | Out-File .\editor\message.go -Encoding UTF8
# # $data=Get-Content .\editor\window.go | % { $_ -replace "DrawText6", "DrawText5" }
# # $data | Out-File .\editor\window.go -Encoding UTF8
# # $data=Get-Content .\editor\screen.go | % { $_ -replace "NewQVariant5", "NewQVariant2" }
# # $data | Out-File .\editor\screen.go -Encoding UTF8
# # $ch1="), text, gui.NewQTextOption2(core.Qt__AlignVCenter),"
# # $rep1="), int(core.Qt__AlignVCenter), text, nil,"
# # $data=Get-Content .\editor\window.go | % { $_ -replace [regex]::Escape($ch1), $rep1 }
# # $data | Out-File .\editor\window.go -Encoding UTF8
# # $data=Get-Content .\editor\cursor.go | % { $_ -replace "DrawText6", "DrawText5" }
# # $data | Out-File .\editor\cursor.go -Encoding UTF8
# # $data=Get-Content .\editor\cursor.go | % { $_ -replace "NewQVariant10", "NewQVariant12" }
# # $data | Out-File .\editor\cursor.go -Encoding UTF8
# # $ch2="), text, gui.NewQTextOption2(core.Qt__AlignVCenter),"
# # $rep2="), int(core.Qt__AlignVCenter), text, nil,"
# # $data=Get-Content .\editor\cursor.go | % { $_ -replace [regex]::Escape($ch2), $rep2 }
# # $data | Out-File .\editor\cursor.go -Encoding UTF8
# # $data=Get-Content .\util\utils.go | % { $_ -replace "SetOffset2", "SetOffset3" }
# # $data | Out-File .\util\utils.go -Encoding UTF8
# # - name: Test
# # env:
# # QT_API: 5.13.0
# # run: go test github.com\akiyosi\goneovim\editor
# - name: Retrieve version
# id: version-windows
# run: |
# cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
# echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
# - name: Build
# env:
# QT_API: 5.13.0
# run: |
# cd ${{ github.workspace }}\src\github.com\${{ github.repository }}
# go generate
# ${{ github.workspace }}\bin\qtdeploy build desktop ./cmd/goneovim
# Copy-Item -Force -Recurse -Path ../../runtime -Destination ./deploy/windows/
# - name: Upload for windows
# uses: actions/upload-artifact@v1
# with:
# name: goneovim-windows-msvc
# path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/windows
############################################
# freebsd
############################################
# test-and-build-freebsd:
# runs-on: macos-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
#
# - name: Build for freeBSD
# uses: cross-platform-actions/[email protected]
# env:
# GOPATH: /home/runner/go
# QT_PKG_CONFIG: true
# QT_API: 5.13.0
# QT_DEBUG: false
# QT_STATIC: true
# GO111MODULE: on
# GOPROXY: https://goproxy.io
# CGO_CPPFLAGS: '-O3 -Wno-deprecated'
# with:
# environment_variables: GOPATH QT_PKG_CONFIG QT_API QT_DEBUG QT_STATIC GO111MODULE GOPROXY
# operating_system: freebsd
# architecture: x86_64
# version: '13.2'
# shell: bash
# memory: 12G
# cpu_count: 4
# run: |
# yes | sudo pkg install git go pkgconf
# yes | sudo pkg install devel/qt5
# yes | sudo pkg install gmake
# gmake qt_bindings
# gmake deps
# gmake test
# gmake app
#
# - name: check dir
# run: |
# pwd
# ls -l cmd/goneovim/deploy/freebsd
#
# - name: Archive
# run: |
# cd cmd/goneovim/deploy
# mv freebsd goneovim-freebsd
# tar -jcvf goneovim-freebsd.tar.bz2 goneovim-freebsd
#
# - name: Upload for freebsd
# uses: actions/upload-artifact@v1
# with:
# name: goneovim-freebsd
# path: ${{ github.workspace }}/cmd/goneovim/deploy/goneovim-freebsd.tar.bz2