2021-09-26 14:42:50 +02:00
|
|
|
name: build
|
2021-02-14 22:19:38 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-09-25 23:46:53 +02:00
|
|
|
branches:
|
|
|
|
- main
|
2023-02-11 11:17:55 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-02-14 22:19:38 +01:00
|
|
|
release:
|
2021-09-25 23:46:53 +02:00
|
|
|
types:
|
|
|
|
- created
|
2021-02-14 22:19:38 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-03-02 00:48:01 +01:00
|
|
|
# build-fw-hw-sw:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
# steps:
|
|
|
|
# - name: Download SummerCart64 repository
|
|
|
|
# uses: actions/checkout@v3
|
|
|
|
|
|
|
|
# - name: Set SC64 version
|
|
|
|
# uses: frabert/replace-string-action@v2
|
|
|
|
# id: sc64version
|
|
|
|
# with:
|
|
|
|
# pattern: '\/'
|
|
|
|
# string: '-${{ github.ref_name }}'
|
|
|
|
# replace-with: '-'
|
|
|
|
|
|
|
|
# - name: Build everything
|
|
|
|
# run: ./docker_build.sh release --force-clean
|
|
|
|
# env:
|
|
|
|
# SC64_VERSION: ${{ steps.sc64version.outputs.replaced }}
|
|
|
|
|
|
|
|
# - name: Upload artifact
|
|
|
|
# uses: actions/upload-artifact@v3
|
|
|
|
# with:
|
|
|
|
# name: sc64-pkg${{ steps.sc64version.outputs.replaced }}
|
|
|
|
# path: |
|
|
|
|
# sc64-extra${{ steps.sc64version.outputs.replaced }}.zip
|
|
|
|
# sc64-firmware${{ steps.sc64version.outputs.replaced }}.bin
|
|
|
|
|
|
|
|
# - name: Upload release assets
|
|
|
|
# if: github.event_name == 'release' && github.event.action == 'created'
|
|
|
|
# uses: softprops/action-gh-release@v0.1.15
|
|
|
|
# with:
|
|
|
|
# files: |
|
|
|
|
# sc64-extra${{ steps.sc64version.outputs.replaced }}.zip
|
|
|
|
# sc64-firmware${{ steps.sc64version.outputs.replaced }}.bin
|
|
|
|
|
|
|
|
build-deployer:
|
2023-02-24 23:27:34 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
include:
|
|
|
|
- os: windows-latest
|
2023-03-02 00:48:01 +01:00
|
|
|
# pyinstaller-build-options: --target-arch=64bit
|
|
|
|
# pyinstaller-options: --onefile --console --icon ../../assets/sc64_logo_256_256.png
|
|
|
|
executable-name: sc64deployer.exe
|
|
|
|
package-name: sc64deployer-windows
|
|
|
|
# package-options: -c -a -f
|
|
|
|
# package-extension: zip
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- os: ubuntu-latest
|
2023-03-02 00:48:01 +01:00
|
|
|
# pyinstaller-options: --onefile
|
2023-03-02 01:15:15 +01:00
|
|
|
linux-packages: libudev-dev
|
2023-03-02 00:48:01 +01:00
|
|
|
executable-name: sc64deployer
|
|
|
|
package-name: sc64deployer-linux
|
|
|
|
# package-options: -czf
|
|
|
|
# package-extension: tar.gz
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- os: macos-latest
|
2023-03-02 00:48:01 +01:00
|
|
|
# pyinstaller-options: --onedir --console --icon ../../assets/sc64_logo_256_256.png
|
|
|
|
executable-name: sc64deployer
|
|
|
|
package-name: sc64deployer-macos
|
|
|
|
# package-options: -czf
|
|
|
|
# package-extension: tgz
|
2021-02-14 22:19:38 +01:00
|
|
|
|
2023-02-24 23:27:34 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download SummerCart64 repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set SC64 version
|
|
|
|
uses: frabert/replace-string-action@v2
|
|
|
|
id: sc64version
|
|
|
|
with:
|
|
|
|
pattern: '\/'
|
|
|
|
string: '-${{ github.ref_name }}'
|
|
|
|
replace-with: '-'
|
|
|
|
|
2023-03-02 00:54:24 +01:00
|
|
|
- name: Install required linux packages
|
2023-03-02 01:15:15 +01:00
|
|
|
if: matrix.linux-packages
|
2023-03-02 00:56:41 +01:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-03-02 01:15:15 +01:00
|
|
|
sudo apt-get -y install ${{ matrix.linux-packages }}
|
2023-03-02 00:54:24 +01:00
|
|
|
|
2023-03-02 00:48:01 +01:00
|
|
|
- name: Build deployer
|
|
|
|
run: cargo b -r
|
|
|
|
working-directory: sw/deployer
|
|
|
|
|
|
|
|
# - name: Setup python
|
|
|
|
# uses: actions/setup-python@v4
|
|
|
|
# with:
|
|
|
|
# python-version: '3.11'
|
|
|
|
|
|
|
|
# - name: Download pyinstaller repository
|
|
|
|
# uses: actions/checkout@v3
|
|
|
|
# with:
|
|
|
|
# repository: 'pyinstaller/pyinstaller'
|
|
|
|
# ref: 'v5.8.0'
|
|
|
|
# path: pyinstaller
|
|
|
|
|
|
|
|
# - name: Compile and install pyinstaller
|
|
|
|
# run: |
|
|
|
|
# pip3 uninstall pyinstaller
|
|
|
|
# pip3 install wheel
|
|
|
|
# pushd bootloader
|
|
|
|
# python3 ./waf all ${{ matrix.pyinstaller-build-options }}
|
|
|
|
# popd
|
|
|
|
# pip3 install .
|
|
|
|
# working-directory: pyinstaller
|
|
|
|
|
|
|
|
# - name: Install sc64.py requirements
|
|
|
|
# run: pip3 install -r requirements.txt
|
|
|
|
# working-directory: sw/pc
|
|
|
|
|
|
|
|
# - name: Create sc64.py executable
|
|
|
|
# run: python3 -m PyInstaller --clean ${{ matrix.pyinstaller-options }} sc64.py
|
|
|
|
# working-directory: sw/pc
|
|
|
|
|
|
|
|
# - name: Package executable
|
|
|
|
# run: |
|
|
|
|
# mkdir package
|
|
|
|
# pushd dist
|
|
|
|
# tar ${{ matrix.package-options }} ../package/${{ matrix.package-name }}${{ steps.sc64version.outputs.replaced }}.${{ matrix.package-extension }} *
|
|
|
|
# popd
|
|
|
|
# working-directory: sw/pc
|
2023-02-24 23:27:34 +01:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.package-name }}${{ steps.sc64version.outputs.replaced }}
|
2023-03-02 00:48:01 +01:00
|
|
|
path: sw/deployer/target/release/${{ matrix.executable-name }}
|
|
|
|
# path: sw/pc/package/${{ matrix.package-name }}${{ steps.sc64version.outputs.replaced }}.${{ matrix.package-extension }}
|
|
|
|
|
|
|
|
# - name: Upload release assets
|
|
|
|
# if: github.event_name == 'release' && github.event.action == 'created'
|
|
|
|
# uses: softprops/action-gh-release@v0.1.15
|
|
|
|
# with:
|
|
|
|
# files: |
|
|
|
|
# sw/pc/package/${{ matrix.package-name }}${{ steps.sc64version.outputs.replaced }}.${{ matrix.package-extension }}
|