Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #31

Merged
merged 24 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions .github/workflows/jni_libs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: JNI Libs

on:
push:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
pull_request:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy

defaults:
run:
shell: bash

jobs:

build-macos-jni-artifact:
name: JNI Artifact macOS Build
runs-on: macos-11
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: install deps
run: brew install git automake yasm nasm

- name: build deps
run: |
ls -al
id
pwd
./circle_scripts/deps_macos.sh

- name: build jni lib
run: |
ls -al
id
pwd
./circle_scripts/java_jni_lib_macos.sh

- name: sha hash of jni lib
run: |
shasum -a 256 /Users/runner/ToxAndroidRefImpl/jni-c-toxcore/libjni-c-toxcore.jnilib || echo "ignore"

- name: Rename artifact for nightly upload
if: github.ref == 'refs/heads/master'
run: |
pwd
cp -v /Users/runner/ToxAndroidRefImpl/jni-c-toxcore/libjni-c-toxcore.jnilib libjni-c-toxcore.jnilib
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: libjni-c-toxcore.jnilib
path: libjni-c-toxcore.jnilib
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "libjni-c-toxcore.jnilib"

build-linux-jni-artifact:
name: JNI Artifact Linux Build
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: install deps
run: |
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
ca-certificates \
openjdk-17-jdk \
openjdk-17-jdk-headless \
coreutils autoconf libtool pkg-config \
yasm

- name: build deps
run: |
ls -al
id
pwd
./circle_scripts/deps_linux.sh

- name: build jni lib
run: |
ls -al
id
pwd
./circle_scripts/java_jni_lib_linux.sh

- name: sha hash of jni lib
run: |
sha256sum /home/runner/work/trifa_material/trifa_material/libjni-c-toxcore.so || echo "ignore"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: libjni-c-toxcore.so
path: libjni-c-toxcore.so
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "libjni-c-toxcore.so"


build-windows-jni-artifact:
name: JNI Artifact Windows Build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: install deps
run: |
sudo apt-get update && \
sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
ca-certificates \
yasm \
openjdk-17-jdk \
openjdk-17-jdk-headless \
coreutils autoconf libtool pkg-config \
gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 \
mingw-w64-tools pkg-config-mingw-w64-x86-64 win-iconv-mingw-w64-dev \
mingw-w64-x86-64-dev


- name: build deps
run: |
ls -al
id
pwd
./circle_scripts/deps_win.sh

- name: build jni lib
run: |
ls -al
id
pwd
./circle_scripts/java_jni_lib_win.sh

- name: sha hash of jni lib
run: |
sha256sum /home/runner/work/trifa_material/trifa_material/jni-c-toxcore.dll || echo "ignore"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: jni-c-toxcore.dll
path: jni-c-toxcore.dll
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "jni-c-toxcore.dll"

70 changes: 0 additions & 70 deletions .github/workflows/jni_macos.yml

This file was deleted.

13 changes: 9 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,13 @@ jobs:
run: echo %PATH%
shell: cmd

- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: java-version
run: set -x ; "$JAVA_HOME_17_X64/bin/java.exe" -version
run: java -version
shell: bash

- name: download tester
Expand All @@ -439,17 +444,17 @@ jobs:
javac -version

- name: compile-app
shell: bash
run: |
./gradlew.bat -Dorg.gradle.java.home=C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.8-101\x64 assemble
shell: cmd
./gradlew.bat assemble

- name: startup-app
shell: pwsh
run: |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Start-Sleep -Seconds 30
Start-Process -FilePath 'C:\Windows\System32\cmd.exe' -WorkingDirectory "D:\a\trifa_material\trifa_material" -ArgumentList '/c', 'D:\a\trifa_material\trifa_material\gradlew.bat', "-Dorg.gradle.java.home=C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\17.0.8-101\x64", "run" -windowstyle Maximized
Start-Process -FilePath 'C:\Windows\System32\cmd.exe' -WorkingDirectory "D:\a\trifa_material\trifa_material" -ArgumentList '/c', 'D:\a\trifa_material\trifa_material\gradlew.bat', "run" -windowstyle Maximized
Start-Sleep -Seconds 20
Start-Sleep -Seconds 8
$signature=@'
Expand Down
11 changes: 10 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions circle_scripts/deps_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export MAKEFLAGS
WGET_OPTIONS="--timeout=10"
export WGET_OPTIONS

FLAGS_ASAN='-fsanitize=address -fno-omit-frame-pointer' # -static-libasan'
CXXFLAGS_ADDON='-O2 -g -fPIC'
CFLAGS_ADDON='-O2 -g -fPIC'
CXXFLAGS_ADDON='-O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong'
CFLAGS_ADDON='-O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-protector-strong'
CFLAGS_MORE='--param=ssp-buffer-size=1 -fstack-protector-all'
# ----------- config ------------

Expand Down Expand Up @@ -108,6 +107,8 @@ export LDFLAGS=" "
--disable-demuxers \
--disable-parsers \
--disable-bsfs \
--disable-libxcb \
--disable-libxcb-shm \
--enable-parser=h264 \
--enable-decoder=h264 || exit 1

Expand Down Expand Up @@ -253,7 +254,7 @@ cd "$_SRC_"
# seems man pages are not always built. but who needs those
touch nasm.1
touch ndisasm.1
make install
sudo make install

type -a nasm

Expand Down
Loading