tdlight-java/.github/workflows/maven-publish.yml

55 lines
2.0 KiB
YAML
Raw Normal View History

2020-12-29 23:38:50 +01:00
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Maven Package
on:
2020-12-29 23:41:27 +01:00
push:
2020-12-29 23:38:50 +01:00
jobs:
build:
strategy:
matrix:
include:
- { os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlight" }
- { os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlib" }
runs-on: ${{ matrix.os }}
steps:
2021-07-28 11:40:47 +02:00
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
2021-07-28 11:42:52 +02:00
echo ::set-output name=SOURCE_TAG_VERSION::${GITHUB_REF#refs/tags/v}
2020-12-29 23:38:50 +01:00
- uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup variables
shell: bash
run: |
# ====== Variables
2021-07-28 11:42:52 +02:00
export REVISION=${{ steps.branch_name.outputs.SOURCE_TAG_VERSION }}
2020-12-29 23:38:50 +01:00
export IMPLEMENTATION_NAME=${{ matrix.implementation }}
echo "REVISION=$REVISION" >> $GITHUB_ENV
echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV
- name: Set up JDK 11
2021-07-28 12:17:25 +02:00
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
2020-12-29 23:38:50 +01:00
uses: actions/setup-java@v1
with:
java-version: 11
2020-12-29 23:38:50 +01:00
server-id: mchv-release-distribution
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy to Maven (Release)
2021-07-28 12:17:25 +02:00
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
2020-12-29 23:38:50 +01:00
shell: bash
run: |
echo "REVISION: $REVISION"
echo "IMPLEMENTATION_NAME: $IMPLEMENTATION_NAME"
source ./scripts/continuous-integration/github-workflows/deploy-release.sh
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}