Skip to content

0.4.0

0.4.0 #9

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build
on:
release:
types: [published]
jobs:
deploy:
runs-on: ${{ matrix.cfg.os }}
defaults:
run:
shell: bash
strategy:
matrix:
cfg:
- { os: windows-latest, python-version: "3.10", architecture: x64 }
# - { os: windows-latest, python-version: "3.10", architecture: x86 }
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.cfg.python-version }} ${{ matrix.cfg.architecture }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.cfg.python-version }}
architecture: ${{ matrix.cfg.architecture }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller pillow
- name: PyInstaller build
run: python -m PyInstaller -y nbt-to-mcstructure.spec
- name: Create Release Asset
run: |
built_path=nbt-to-mcstructure_v${{ github.event.release.tag_name }}_${{ runner.os }}_${{ matrix.cfg.architecture }}.zip
echo "BUILT_PATH=$built_path" >> $GITHUB_ENV
cp ./structures ./dist -r
cp ./assets ./dist -r
rm ./dist/assets/demo_video.gif
rm ./dist/assets/vanilla_structures.zip
cd dist
if [ "${{ runner.os }}" == "Windows" ]; then
7z a $built_path .
elif [ "${{ runner.os }}" == "macOS" ]; then
zip -r $built_path .
else
echo "${{ runner.os }} not supported"
exit 1
fi
cd ..
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist/${{ env.BUILT_PATH }}
asset_name: ${{ env.BUILT_PATH }}
asset_content_type: application/zip