Build Linux #8
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 Linux | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore .NET dependencies | |
run: | | |
cd ./ModManagerCore | |
dotnet restore | |
- name: Build .NET project | |
run: | | |
cd ./ModManagerCore | |
dotnet build --configuration Release | |
- name: Publish .NET project | |
run: | | |
cd ./ModManagerCore | |
dotnet publish --configuration Release --output ${{ github.workspace }}/publish/Core --self-contained -r linux-x64 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies for Python | |
run: | | |
python -m pip install --upgrade pip | |
pip install PySide6 pyinstaller | |
- name: Build ModManagerGUI with PyInstaller | |
run: | | |
cd ModManagerGUI # Change to the ModManagerGUI directory | |
ls # List contents to debug if needed | |
pyinstaller --add-data "${{ github.workspace }}/publish/Core:Core" --name ModManagerGUI --windowed main.py | |
- name: Zip ModManagerGUI directory | |
run: | | |
cd ${{ github.workspace }}/ModManagerGUI/dist | |
zip -r ModManagerGUI.zip ModManagerGUI | |
- name: Create a new release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: linux_${{ github.run_number }} | |
release_name: "Linux Release ${{ github.run_number }}" # Optional, you can change the name | |
draft: false # Set to true if you want to create a draft release | |
prerelease: false # Set to true if it's a prerelease | |
body: "Release for Linux" | |
- name: Upload ModManagerGUI artifact to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ModManagerGUI/dist/ModManagerGUI.zip | |
asset_name: ModManagerGUI.zip | |
asset_content_type: application/zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |