tdlight-java-natives/.github/workflows/tdapi_file.yaml

133 lines
5.4 KiB
YAML
Raw Normal View History

name: Generate TdApi.java
2020-12-26 12:09:32 +01:00
on:
push:
jobs:
build:
strategy:
matrix:
2020-12-26 12:20:40 +01:00
include:
- {os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlight"}
2021-10-22 11:06:14 +02:00
#- {os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlib"}
2020-12-26 12:16:14 +01:00
runs-on: ${{ matrix.os }}
2020-12-26 12:09:32 +01:00
steps:
2020-12-26 12:38:55 +01:00
- name: Install sudo package
2020-12-26 12:42:01 +01:00
if: runner.os == 'Linux'
2020-12-26 12:38:55 +01:00
run: |
(apt-get update || true) 2>/dev/null
(apt-get install -y sudo || true) 2>/dev/null
sudo apt update
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.IG_SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.IG_KNOWN_HOSTS }}
2020-12-26 12:38:55 +01:00
- uses: actions/checkout@v2
with:
submodules: "recursive"
2020-12-28 00:16:13 +01:00
- name: Setup Java (Snapshot)
if: github.ref != 'refs/heads/master'
2020-12-26 12:16:14 +01:00
uses: actions/setup-java@v1
with:
2021-10-22 11:16:57 +02:00
java-version: 17
server-id: mchv-snapshot-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
2020-12-28 00:16:13 +01:00
- name: Setup Java (Release)
if: github.ref == 'refs/heads/master'
uses: actions/setup-java@v1
with:
2021-10-22 11:16:57 +02:00
java-version: 17
2020-12-28 00:16:13 +01:00
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
2020-12-26 12:09:32 +01:00
- name: Setup variables
2020-12-26 12:42:01 +01:00
shell: bash
2020-12-26 12:09:32 +01:00
run: |
# ====== Variables
2020-12-26 12:45:53 +01:00
export REVISION=${{ github.run_number }}
export GH_MATRIX_OS=${{ matrix.os }}
2020-12-26 12:45:53 +01:00
export GH_MATRIX_ARCH=${{ matrix.arch }}
2020-12-26 15:39:42 +01:00
export IMPLEMENTATION_NAME=${{ matrix.implementation }}
2020-12-26 12:36:31 +01:00
source ./scripts/continuous-integration/github-workflows/setup-variables.sh
2020-12-26 12:36:31 +01:00
2020-12-26 12:09:32 +01:00
echo "REVISION=$REVISION" >> $GITHUB_ENV
2021-01-05 12:54:13 +01:00
echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV
2020-12-26 15:39:42 +01:00
echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV
2020-12-26 12:09:32 +01:00
echo "TD_SRC_DIR=$TD_SRC_DIR" >> $GITHUB_ENV
echo "TD_BIN_DIR=$TD_BIN_DIR" >> $GITHUB_ENV
echo "TDNATIVES_BIN_DIR=$TDNATIVES_BIN_DIR" >> $GITHUB_ENV
echo "TDNATIVES_CPP_SRC_DIR=$TDNATIVES_CPP_SRC_DIR" >> $GITHUB_ENV
echo "TDNATIVES_DOCS_BIN_DIR=$TDNATIVES_DOCS_BIN_DIR" >> $GITHUB_ENV
echo "TD_BUILD_DIR=$TD_BUILD_DIR" >> $GITHUB_ENV
echo "TDNATIVES_CPP_BUILD_DIR=$TDNATIVES_CPP_BUILD_DIR" >> $GITHUB_ENV
echo "JAVA_SRC_DIR=$JAVA_SRC_DIR" >> $GITHUB_ENV
echo "TDLIB_SERIALIZER_DIR=$TDLIB_SERIALIZER_DIR" >> $GITHUB_ENV
2021-09-14 15:03:15 +02:00
if [[ ! -z "$PATH" ]]; then
echo "PATH=$PATH" >> $GITHUB_ENV
fi
2020-12-26 12:09:32 +01:00
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "JAVA_INCLUDE_PATH=$JAVA_INCLUDE_PATH" >> $GITHUB_ENV
echo "CMAKE_EXTRA_ARGUMENTS=$CMAKE_EXTRA_ARGUMENTS" >> $GITHUB_ENV
echo "VCPKG_DIR=$VCPKG_DIR" >> $GITHUB_ENV
echo "MAVEN_OPTS=$MAVEN_OPTS" >> $GITHUB_ENV
echo "GH_CPU_ARCH=$GH_CPU_ARCH" >> $GITHUB_ENV
echo "CPU_ARCH_JAVA=$CPU_ARCH_JAVA" >> $GITHUB_ENV
echo "CPU_ARCHITECTURE_NAME=$CPU_ARCHITECTURE_NAME" >> $GITHUB_ENV
echo "CPU_CORES_NUM=$CPU_CORES_NUM" >> $GITHUB_ENV
echo "CPU_CORES=$CPU_CORES" >> $GITHUB_ENV
echo "OPERATING_SYSTEM_NAME=$OPERATING_SYSTEM_NAME" >> $GITHUB_ENV
echo "OPERATING_SYSTEM_NAME_SHORT=$OPERATING_SYSTEM_NAME_SHORT" >> $GITHUB_ENV
echo "SRC_TDJNI_LIBNAME=$SRC_TDJNI_LIBNAME" >> $GITHUB_ENV
echo "DEST_TDJNI_LIBNAME=$DEST_TDJNI_LIBNAME" >> $GITHUB_ENV
2020-12-26 14:00:49 +01:00
- name: Install dependencies
shell: bash
2020-12-26 12:09:32 +01:00
run: |
2020-12-26 14:00:49 +01:00
echo "REVISION: $REVISION"
2021-01-04 12:02:02 +01:00
./scripts/continuous-integration/github-workflows/install-dependencies.sh
2020-12-26 15:06:44 +01:00
- name: Build
shell: bash
run: |
echo "REVISION: $REVISION"
2021-01-04 12:02:02 +01:00
./scripts/continuous-integration/github-workflows/build-tdapi.sh
- id: getfilename
2020-12-27 19:04:46 +01:00
shell: bash
2021-12-08 01:18:02 +01:00
run: echo "::set-output name=file::$(cd generated-sealed/target; ls tdli*-api-*-SNAPSHOT.jar)"
2020-12-27 19:04:46 +01:00
- id: getfilepath
shell: bash
2021-12-08 01:18:02 +01:00
run: echo "::set-output name=file::$(ls generated-sealed/target/tdli*-api-*-SNAPSHOT.jar)"
2020-12-26 12:09:32 +01:00
- uses: actions/upload-artifact@v2
with:
2020-12-27 19:04:46 +01:00
name: ${{ steps.getfilename.outputs.file }}
path: ${{ steps.getfilepath.outputs.file }}
2020-12-28 00:16:13 +01:00
- name: Deploy to Maven (Snapshot)
2020-12-28 00:13:32 +01:00
if: github.ref != 'refs/heads/master'
shell: bash
run: |
echo "REVISION: $REVISION"
2021-12-08 00:17:22 +01:00
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-snapshot.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-snapshot.sh
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
2020-12-28 00:16:13 +01:00
- name: Deploy to Maven (Release)
2020-12-27 21:08:01 +01:00
if: github.ref == 'refs/heads/master'
shell: bash
run: |
echo "REVISION: $REVISION"
2021-12-08 00:17:22 +01:00
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-release.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-release.sh
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-javadoc.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-javadoc.sh
2020-12-27 21:08:01 +01:00
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
2020-12-26 12:09:32 +01:00