Workflow config file is invalid. Please check your config file: yaml: line 27: block sequence entries are not allowed in this context
Mateusz Faderewski b5d1131835 test
2023-02-24 21:14:23 +01:00

140 lines
4.1 KiB
YAML

name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
workflow_dispatch:
jobs:
build-fw-hw-sw:
runs-on: ubuntu-latest
steps:
- name: Download SummerCart64 repository
uses: actions/checkout@v3
- uses: bluwy/substitute-string-action@v2.0.1
id: sc64version
with:
_input-text: ${{ github.ref_name }}
[\\]: -
# - name: Set SC64 version
# run: |
# echo "$GITHUB_REF_NAME"
# SC64_VERSION=-${GITHUB_REF_NAME//\//-}
# echo "$SC64_VERSION"
- name: Build everything
run: ./docker_build.sh release --force-clean
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: sc64-pkg${{ steps.sc64version.outputs.result }}
path: |
sc64-extra${{ steps.sc64version.outputs.result }}.zip
sc64-firmware${{ steps.sc64version.outputs.result }}.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.result }}.zip
sc64-firmware${{ steps.sc64version.outputs.result }}.bin
build-sc64-py:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
pyinstaller-build-options: --target-arch=64bit
pyinstaller-options: --onefile --console --icon ../../assets/sc64_logo_256_256.png
package-name: sc64-windows
package-options: -c -a -f
package-extension: zip
- os: ubuntu-latest
pyinstaller-options: --onefile
package-name: sc64-linux
package-options: -czf
package-extension: tgz
- os: macos-latest
pyinstaller-options: --onedir --console --icon ../../assets/sc64_logo_256_256.png
package-name: sc64-macos
package-options: -czf
package-extension: tgz
runs-on: ${{ matrix.os }}
steps:
- name: Download SummerCart64 repository
uses: actions/checkout@v3
- name: Set SC64 version
run: |
echo "$GITHUB_REF_NAME"
SC64_VERSION=-${GITHUB_REF_NAME//\//-}
echo "$SC64_VERSION"
- 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 }}${{ env.SC64_VERSION }}.${{ matrix.package-extension }} *
popd
working-directory: sw/pc
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.package-name }}${{ env.SC64_VERSION }}
path: sw/pc/package/${{ matrix.package-name }}${{ env.SC64_VERSION }}.${{ 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 }}${{ env.SC64_VERSION }}.${{ matrix.package-extension }}