Skip to content

[ci] Add release to workflow. #58

[ci] Add release to workflow.

[ci] Add release to workflow. #58

Workflow file for this run

name: Switchres CIv2

Check failure on line 1 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

Invalid `steps` value - steps should be list of `uses` or `run` items
on: [push, pull_request]
jobs:
buildx86_64:
runs-on: ubuntu-latest
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
strategy:
matrix:
platform:
- { name: linux_gcc }
- { name: windows_mingw, make_opts: PLATFORM=NT CROSS_COMPILE=x86_64-w64-mingw32- }
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: matrix.platform.name == 'Linux GCC'
run: sudo apt-get install libxrandr-dev libdrm-dev libsdl2-dev
- name: Install Windows dependencies
if: matrix.platform.name == 'Windows MINGW'
run: |
sudo apt-get install mingw-w64 wget tar
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
wget https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
tar xvzf SDL2-devel-2.26.2-mingw.tar.gz
sudo make -C SDL2-2.26.2 CROSS_PATH=/usr ARCHITECTURES=x86_64-w64-mingw32 cross
wget https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-devel-2.20.1-mingw.tar.gz
tar xvzf SDL2_ttf-devel-2.20.1-mingw.tar.gz
sudo make -C SDL2_ttf-2.20.1 CROSS_PATH=/usr ARCHITECTURES=x86_64-w64-mingw32 cross
- name: Build libs and binary
run: |
make libswitchres ${{matrix.platform.make_opts}}
make ${{matrix.platform.make_opts}}
- name: Build grid.exe (Windows only)
if: matrix.platform.name == 'Windows MINGW'
run: |
make ${{matrix.platform.make_opts}} clean
make ${{matrix.platform.make_opts}} grid
- name: Prepare artifacts
run: mkdir artifacts && cp -v libswitchres.{so,a,dll,lib} switchres{,.exe,.ini} grid{,.exe} /usr/x86_64-w64-mingw32/bin/SDL2{,_ttf}.dll /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll artifacts/ || true
- name: Upload artifact
uses: actions/[email protected]
with:
name: switchres-${{matrix.platform.name}}-x86_64
path: artifacts/
win32-build-x86_64-geometry:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build geometry.exe
run: |
pip install pyinstaller
pyinstaller --onefile geometry.py --icon=tv.ico
- name: Upload artifact
uses: actions/[email protected]
with:
name: geometry-win32-x86_64
path: dist/
release:
runs-on: ubuntu-latest
needs: [jobs, win32-build-x86_64-geometry]
if: startsWith(github.ref, 'refs/tags/v')
steps:
-name: Download artifacts
uses: actions/[email protected]
-name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Switchres ${GITHUB_REF#refs/*/}
draft: true
prerelease: false
files: |
./switchres-linux_gcc-x86_64/*.zip
./switchres-windows_mingw/*.zip
./geometry-win32-x86_64/*.zip