name: Generate TdApi.java
on:
push:
branches:
- master
- develop
jobs:
build:
strategy:
matrix:
include:
- {os: ubuntu-22.04, arch: "linux/amd64", implementation: "tdlight"}
runs-on: ${{ matrix.os }}
steps:
- name: Install ubuntu 22.04 dependencies
if: matrix.os == 'ubuntu-22.04'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: sudo make git zlib1g-dev libssl-dev gperf php-cli cmake default-jdk clang-14 libc++-14-dev libc++abi-14-dev ccache maven
version: 1.0
- 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 }}
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup Java (Snapshot)
if: github.ref == 'refs/heads/develop'
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
server-id: mchv-snapshot-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup Java (Release)
if: github.ref != 'refs/heads/develop'
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup variables
shell: bash
run: |
# ====== Variables
export REVISION=${{ github.run_number }}
export GH_MATRIX_OS=${{ matrix.os }}
export GH_MATRIX_ARCH=${{ matrix.arch }}
export IMPLEMENTATION_NAME=${{ matrix.implementation }}
echo "REVISION=$REVISION" >> $GITHUB_ENV
echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV
echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV
if [[ ! -z "$PATH" ]]; then
echo "PATH=$PATH" >> $GITHUB_ENV
fi
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "JAVA_INCLUDE_PATH=$JAVA_INCLUDE_PATH" >> $GITHUB_ENV
- name: Build
shell: bash
run: |
echo "REVISION: $REVISION"
./.github/workflows/scripts/build-api.sh
- name: Deploy to Maven (Snapshot)
if: github.ref != 'refs/heads/master'
shell: bash
run: |
echo "REVISION: $REVISION"
echo "Deploying legacy package"
mvn -f api/pom.xml package deploy -Dlegacy=true -Drevision="-1.0.0.0-SNAPSHOT"
echo "Building standard package"
mvn -f api/pom.xml package deploy -Drevision="-1.0.0.0-SNAPSHOT"
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
- name: Deploy to Maven (Release)
if: github.ref == 'refs/heads/master'
shell: bash
run: |
echo "REVISION: $REVISION"
echo "Deploying legacy package"
mvn -f api/pom.xml package deploy -Dlegacy=true -Drevision="$REVISION"
echo "Deploying standard package"
mvn -f api/pom.xml package deploy -Drevision="$REVISION"
echo "Deploying docs"
cd "./api/target/apidocs"
find . -name '*.html' -exec sed -i -r 's/<\/title>/<\/title>\n