v5.5.4.1 #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
pkgrel: | |
description: pkgrel | |
type: number | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pull docker image | |
run: | | |
docker pull ghcr.io/telegramdesktop/tdesktop/centos_env | |
docker tag ghcr.io/telegramdesktop/tdesktop/centos_env materialgram:build | |
- name: Set Repository name & Tag name | |
run: | | |
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
echo "TAGNAME=$(curl -s "${{ github.api_url }}/repos/${{ github.repository }}/tags" | jq -r '.[0].name')" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
path: ${{ env.REPO_NAME }} | |
- name: Build materialgram | |
run: | | |
cd $REPO_NAME | |
DEFINE="" | |
if [ -n "${{ matrix.defines }}" ]; then | |
DEFINE="-D ${{ matrix.defines }}=ON" | |
echo Define from matrix: $DEFINE | |
echo "ARTIFACT_NAME=materialgram_${{ matrix.defines }}" >> $GITHUB_ENV | |
else | |
echo "ARTIFACT_NAME=materialgram" >> $GITHUB_ENV | |
fi | |
docker run --rm \ | |
-v $PWD:/usr/src/tdesktop \ | |
-e CONFIG=Release \ | |
materialgram:build \ | |
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ | |
-D CMAKE_EXE_LINKER_FLAGS="-s" \ | |
-D TDESKTOP_API_ID=${{ secrets.API_ID }} \ | |
-D TDESKTOP_API_HASH=${{ secrets.API_HASH }} \ | |
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \ | |
$DEFINE | |
- name: Create Tar | |
run: | | |
cd $REPO_NAME/arch | |
bash setup.sh | |
tar -czvf materialgram-${{ env.TAGNAME }}.tar.gz usr | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: materialgram-${{ env.TAGNAME }} | |
path: ${{ env.REPO_NAME }}/arch/materialgram-${{ env.TAGNAME }}.tar.gz | |
- name: Upload artifact to Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.TAGNAME }} | |
tag_name: ${{ env.TAGNAME }} | |
token: ${{ secrets.PAT }} | |
files: ${{ env.REPO_NAME }}/arch/materialgram-${{ env.TAGNAME }}.tar.gz | |
trigger-workflow: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Set PKGREL & TAGNAME | |
run: | | |
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then | |
PKGREL="${{ github.event.inputs.pkgrel }}" | |
else | |
PKGREL="1" | |
fi | |
echo "PKGREL=$PKGREL" >> $GITHUB_ENV | |
echo "TAGNAME=$(curl -s "${{ github.api_url }}/repos/${{ github.repository }}/tags" | jq -r '.[0].name')" >> $GITHUB_ENV | |
- name: Trigger repository dispatch event | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.OKsPAT }} | |
repository: materialgram/materialgram-bin | |
event-type: new-release | |
client-payload: '{"tagname": "${{ env.TAGNAME }}", "pkgrel": "${{ env.PKGREL }}"}' | |