Clean up repo and release v1.0.0 #13
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Triggers on tags like v1.0.0, v2.0.1, etc. | |
jobs: | |
build-windows: | |
name: Build on Windows | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
- name: Build CLI Executable | |
run: | | |
pyinstaller --onefile --name openscad-batch-export openscad_export/export.py | |
- name: Build GUI Executable | |
run: | | |
pyinstaller --onefile --windowed --name openscad-batch-export-gui openscad_export/gui.py | |
- name: Package Executables | |
run: | | |
New-Item -ItemType Directory -Force -Path build | |
Compress-Archive -Path dist\openscad-batch-export.exe, dist\openscad-batch-export-gui.exe -DestinationPath build\openscad-batch-export-windows.zip | |
- name: Upload Windows Executable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-executables | |
path: build/openscad-batch-export-windows.zip | |
build-linux: | |
name: Build on Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install pyinstaller | |
- name: Build CLI Executable | |
run: | | |
pyinstaller --onefile --name openscad-batch-export openscad_export/export.py | |
- name: Build GUI Executable | |
run: | | |
pyinstaller --onefile --windowed --name openscad-batch-export-gui openscad_export/gui.py | |
- name: Package Executables | |
run: | | |
mkdir -p build | |
tar -czvf build/openscad-batch-export-linux.tar.gz -C dist openscad-batch-export openscad-batch-export-gui | |
- name: Upload Linux Executable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-executables | |
path: build/openscad-batch-export-linux.tar.gz | |
build-macos: | |
name: Build on macOS | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install pyinstaller | |
- name: Build CLI Executable | |
run: | | |
pyinstaller --onefile --name openscad-batch-export openscad_export/export.py | |
- name: Build GUI Executable | |
run: | | |
pyinstaller --onefile --windowed --name openscad-batch-export-gui openscad_export/gui.py | |
- name: Package Executables | |
run: | | |
mkdir -p build | |
tar -czvf build/openscad-batch-export-macos.tar.gz -C dist openscad-batch-export openscad-batch-export-gui | |
- name: Upload macOS Executable | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-executables | |
path: build/openscad-batch-export-macos.tar.gz | |
release: | |
name: Create GitHub Release | |
runs-on: ubuntu-latest | |
needs: [build-windows, build-linux, build-macos] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Download Windows Executables | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-executables | |
path: ./windows | |
- name: Download Linux Executables | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-executables | |
path: ./linux | |
- name: Download macOS Executables | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-executables | |
path: ./macos | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: "Release ${{ github.ref_name }}" | |
body: | | |
## Release ${{ github.ref_name }} | |
Description of the release. | |
draft: false | |
prerelease: false | |
- name: Upload Windows Executable to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./windows/openscad-batch-export-windows.zip | |
asset_name: openscad-batch-export-windows.zip | |
asset_content_type: application/zip | |
- name: Upload Linux Executable to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./linux/openscad-batch-export-linux.tar.gz | |
asset_name: openscad-batch-export-linux.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload macOS Executable to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./macos/openscad-batch-export-macos.tar.gz | |
asset_name: openscad-batch-export-macos.tar.gz | |
asset_content_type: application/gzip |