fix a bug #2
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: 'Build (Beta Ver.)' | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: [self-hosted, linux, x64] | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Setting up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements.txt | |
- name: Update Pip and Install Requirements | |
run: | | |
pip install -U pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build on Linux | |
run: | | |
pyinstaller --onefile --icon=onedisc.ico | |
- name: Get version number | |
run: | | |
export VERSION=$(python -c 'print(__import__("version").VERSION)') | |
export SUB_VER=$(git rev-list --no-merges --count $(git describe --tags --abbrev=0)..HEAD) | |
echo "VERSION=$VERSION.$SUB_VER" >> GITHUB_ENV | |
echo "Currect Version Number: $VERSION.$SUB_VER" | |
- name: Compress file | |
run: | | |
sudo apt update | |
sudo apt install zip -y | |
cd dist | |
mv main onedisc | |
zip -r "../../OneDisc-linux-x86_64-dev.zip" onedisc | |
cd ../.. | |
git clone https://github.com/ITCraftDevelopmentTeam/OneDisc-Homepage.git | |
cd OneDisc-Homepage/docs/public | |
mkdir downloads --parents | |
cd downloads | |
mv ../../../../OneDisc-linux-x86_64-dev.zip . | |
git add -A | |
git commit -m "Update version to $VERSION" | |
git push | |
env: | |
VERSION: ${{ env.VERSION }} | |