Fix syntax

This commit is contained in:
Andrea Cavalli 2021-03-15 18:59:29 +01:00
parent 3b8c212bee
commit 80c663e377

View File

@ -12,43 +12,29 @@ jobs:
strategy:
matrix:
include:
- {os: ubuntu-20.04, usedocker: true, arch: "linux/386", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/386", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/amd64", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/amd64", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm/v6", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm/v6", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm/v7", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm/v7", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm64", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: true, arch: "linux/arm64", implementation: "tdlib"}
- {os: windows-2019, usedocker: false, arch: "amd64", implementation: "tdlight"}
- {os: windows-2019, usedocker: false, arch: "amd64", implementation: "tdlib"}
- {os: macos-10.15, usedocker: false, arch: "amd64", implementation: "tdlight"}
- {os: macos-10.15, usedocker: false, arch: "amd64", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/386", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/386", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/amd64", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/amd64", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm/v6", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm/v6", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm/v7", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm/v7", implementation: "tdlib"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm64", implementation: "tdlight"}
- {os: ubuntu-20.04, usedocker: "true", arch: "linux/arm64", implementation: "tdlib"}
- {os: windows-2019, usedocker: "false", arch: "amd64", implementation: "tdlight"}
- {os: windows-2019, usedocker: "false", arch: "amd64", implementation: "tdlib"}
- {os: macos-10.15, usedocker: "false", arch: "amd64", implementation: "tdlight"}
- {os: macos-10.15, usedocker: "false", arch: "amd64", implementation: "tdlib"}
steps:
- name: Checkout current repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup Java (Snapshot)
if: github.ref != 'refs/heads/master'
uses: actions/setup-java@v1
with:
java-version: 11
server-id: mchv-snapshot-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup Java (Release)
if: github.ref == 'refs/heads/master'
uses: actions/setup-java@v1
with:
java-version: 11
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Get version
if: matrix.usedocker
if: matrix.usedocker == 'true'
run: |
# Get latest commit short hash
HASH_VERSION=$(git rev-parse --short HEAD)
@ -81,15 +67,15 @@ jobs:
cat $GITHUB_ENV > github.env
- name: Set up QEMU
if: matrix.usedocker
if: matrix.usedocker == 'true'
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: matrix.usedocker
if: matrix.usedocker == 'true'
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
if: matrix.usedocker
if: matrix.usedocker == 'true'
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
@ -98,7 +84,7 @@ jobs:
${{ runner.os }}-buildx-${{ env.SAFE_ARCH }}-
- name: Build image
if: matrix.usedocker
if: matrix.usedocker == 'true'
uses: docker/build-push-action@v2
with:
context: .
@ -117,14 +103,29 @@ jobs:
IMPLEMENTATION_NAME=${{ matrix.implementation }}
- name: Extract jni from docker image
if: matrix.usedocker
if: matrix.usedocker == 'true'
run: |
mkdir generated
docker cp $(docker create tdlight-java-natives:${{ env.HASH_VERSION }}-${{ env.SAFE_ARCH }}):/usr/src/tdlight-java-natives/generated/. ./generated/.
- name: Setup Java (Snapshot)
if: github.ref == 'refs/heads/develop' && matrix.usedocker == 'false'
uses: actions/setup-java@v1
with:
java-version: 11
server-id: mchv-snapshot-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup Java (Release)
if: github.ref == 'refs/heads/master' && matrix.usedocker == 'false'
uses: actions/setup-java@v1
with:
java-version: 11
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Setup variables
if: !matrix.usedocker
if: matrix.usedocker == 'false'
shell: bash
run: |
# ====== Variables
@ -163,14 +164,14 @@ jobs:
echo "SRC_TDJNI_LIBNAME=$SRC_TDJNI_LIBNAME" >> $GITHUB_ENV
echo "DEST_TDJNI_LIBNAME=$DEST_TDJNI_LIBNAME" >> $GITHUB_ENV
- name: Install dependencies
if: !matrix.usedocker
if: matrix.usedocker == 'false'
shell: bash
run: |
echo "REVISION: $REVISION"
source ./scripts/continuous-integration/github-workflows/install-dependencies.sh
- name: Build
if: !matrix.usedocker
if: matrix.usedocker == 'false'
shell: bash
run: |
echo "REVISION: $REVISION"