Fixed schematics not generating, refactored code #39
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: Release | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
platform: macos | |
CMD_BUILD: pyinstaller --onefile --add-data "*.png:." --add-data "*.txt:." --hidden-import pkg_resources.py2_warn --name "Image2MCBlock-macos" --additional-hooks-dir=. main.py | |
OUT_FILE_NAME: Image2MCBlock-macos | |
ASSET_MIME: application/octet-stream | |
- os: windows-latest | |
platform: windows | |
CMD_BUILD: pyinstaller --onefile --add-data "*.png;." --add-data "*.txt;." --hidden-import pkg_resources.py2_warn --name Image2MCBlock-windows --additional-hooks-dir=. main.py | |
OUT_FILE_NAME: Image2MCBlock-windows.exe | |
ASSET_MIME: application/vnd.microsoft.portable-executable | |
- os: ubuntu-latest | |
platform: linux | |
CMD_BUILD: pyinstaller --onefile --add-data "*.png:." --add-data "*.txt:." --hidden-import pkg_resources.py2_warn --name "Image2MCBlock-linux" --additional-hooks-dir=. main.py | |
OUT_FILE_NAME: Image2MCBlock-linux | |
ASSET_MIME: application/octet-stream | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
pip install -r requirements.txt | |
- name: Build executable | |
run: ${{ matrix.CMD_BUILD }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Image2MCBlock-${{ matrix.platform }} | |
path: dist/Image2MCBlock-${{ matrix.platform }}* | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Prepare artifacts | |
run: | | |
mkdir release | |
mv artifacts/Image2MCBlock-linux/Image2MCBlock-linux release/Image2MCBlock-linux | |
mv artifacts/Image2MCBlock-windows/Image2MCBlock-windows.exe release/Image2MCBlock-windows.exe | |
mv artifacts/Image2MCBlock-macos/Image2MCBlock-macos release/Image2MCBlock-macos | |
working-directory: ${{ github.workspace }} | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: 'release/*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |