Skip to content

app: release fixed

app: release fixed #13

Workflow file for this run

name: Release new version of Application
on:
push:
branches: [ "master" ]
env:
ENV_FILE_PATH: ./Syncogram/sourcefiles/telegram/environments.py
JSON_CONFIG_PATH: Syncogram/config.json
jobs:
build_windows:
name: Build Windows App
runs-on: windows-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo "API_ID=${{ secrets.API_ID }}" > ${{ env.ENV_FILE_PATH }};
echo "API_HASH='${{ secrets.API_HASH }}'" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram
flet pack application.py `
--name "Syncogram" `
--icon "assets/logo/icns/duck512x512.icns" `
--product-name "Syncogram Application" `
--product-version "${{ env.json_APP_VERSION }}" `
--company-name "Syncogram Application" `
--copyright "GPL-3.0" `
--file-version "${{ env.json_APP_VERSION }}" `
--add-binary locales:locales `
--add-data assets:assets `
--add-data config.json:. `
--distpath ../craft
cd ../
- name: Archive Windows Application
run: |
7z a Syncogram_Windows.zip $PWD\craft\Syncogram.exe
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "Windows"
path: Syncogram_Windows.zip
build_linux:
name: Build Linux App
runs-on: ubuntu-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo -ne "API_ID=${{ secrets.API_ID }}\n" > ${{ env.ENV_FILE_PATH }};
echo -ne "API_HASH='${{ secrets.API_HASH }}'\n" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram;
flet pack application.py \
--name "Syncogram" \
--icon "assets/logo/icns/duck512x512.icns" \
--product-name "Syncogram Application" \
--product-version "${{ env.json_APP_VERSION }}" \
--company-name "Syncogram Application" \
--copyright "GPL-3.0" \
--file-version "${{ env.json_APP_VERSION }}" \
--add-binary locales:locales \
--add-data assets:assets \
--add-data config.json:. \
--distpath ../craft;
cd ../;
- name: Archive Linux Application
run: |
tar -czvf Syncogram_Linux.tar.gz -C craft Syncogram
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "Linux"
path: Syncogram_Linux.tar.gz
build_macos:
name: Build MacOS App
runs-on: macos-latest
steps:
- name: Clone GitHub Repository
uses: actions/checkout@v3
- name: Creates Telegram Environments Data
run: |
echo -ne "API_ID=${{ secrets.API_ID }}\n" > ${{ env.ENV_FILE_PATH }};
echo -ne "API_HASH='${{ secrets.API_HASH }}'\n" >> ${{ env.ENV_FILE_PATH }};
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Start Build Application
run: |
cd Syncogram;
flet pack application.py \
--name "Syncogram" \
--icon "assets/logo/icns/duck512x512.icns" \
--product-name "Syncogram Application" \
--product-version "${{ env.json_APP_VERSION }}" \
--company-name "Syncogram Application" \
--copyright "GPL-3.0" \
--file-version "${{ env.json_APP_VERSION }}" \
--add-binary locales:locales \
--add-data assets:assets \
--add-data config.json:. \
--distpath ../craft;
cd ../;
- name: Archive MacOS Application
run: |
tar -czvf Syncogram_MacOS.tar.gz -C craft Syncogram.app
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: "MacOS"
path: Syncogram_MacOS.tar.gz
release_project:
name: Release Application
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
steps:
- name: Clone GitHub Repo
uses: actions/checkout@v3
- name: JSON to variables
uses: rgarcia-phi/[email protected]
with:
filename: ${{ env.JSON_CONFIG_PATH }}
- name: Creates Artifacts dir
run: mkdir artifacts
- name: Downloads Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R && pwd
working-directory: artifacts
- name: Create GitHub release
id: create-new-release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: "${{ env.json_APP_VERSION }}"
name: "v${{ env.json_APP_VERSION }}"
body: "Release Syncogram, ${{ env.json_APP_VERSION }}"
artifacts: "artifacts/MacOS/Syncogram_MacOS.tar.gz, artifacts/Linux/Syncogram_Linux.tar.gz, artifacts/Windows/Syncogram_Windows.zip"