mirror of
https://github.com/csd4ni3l/connect-the-current.git
synced 2026-01-01 04:13:41 +01:00
Update to newer workflow file which actually works
This commit is contained in:
96
.github/workflows/main.yml
vendored
96
.github/workflows/main.yml
vendored
@@ -8,7 +8,13 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
include:
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
platform: linux
|
||||||
|
python-version: "3.11"
|
||||||
|
- os: windows-latest
|
||||||
|
platform: windows
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check-out repository
|
- name: Check-out repository
|
||||||
@@ -35,58 +41,78 @@ jobs:
|
|||||||
disable-plugins: tk-inter,dill-compat,eventlet,gevent,pyqt5,pyqt6,pyside2,pyside6,delvewheel,pywebview,matplotlib,spacy,enum-compat,pbr-compat,gevent,pmw-freezer,transformers,upx,kivy,options-nanny,multiprocessing,gi
|
disable-plugins: tk-inter,dill-compat,eventlet,gevent,pyqt5,pyqt6,pyside2,pyside6,delvewheel,pywebview,matplotlib,spacy,enum-compat,pbr-compat,gevent,pmw-freezer,transformers,upx,kivy,options-nanny,multiprocessing,gi
|
||||||
include-data-dir: assets=assets
|
include-data-dir: assets=assets
|
||||||
include-data-files: CREDITS=CREDITS
|
include-data-files: CREDITS=CREDITS
|
||||||
mode: standalone
|
mode: onefile
|
||||||
output-file: Connect the Current
|
output-file: ConnectTheCurrent
|
||||||
|
|
||||||
- name: Zip Build Output
|
- name: Locate and rename executable (Linux)
|
||||||
shell: bash
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p zip_output
|
set -euo pipefail
|
||||||
if [ "${{ runner.os }}" = "Windows" ]; then
|
echo "Searching for built Linux binary..."
|
||||||
powershell.exe -Command "Compress-Archive -Path 'build/run.dist/*' -DestinationPath 'zip_output/Connect the Current-${{ runner.os }}.zip'"
|
# List to help debugging when paths change
|
||||||
else
|
ls -laR . | head -n 500 || true
|
||||||
cd build/run.dist
|
BIN=$(find . -maxdepth 4 -type f -name 'ConnectTheCurrent*' -perm -u+x | head -n1 || true)
|
||||||
zip -r "../../zip_output/Connect the Current-${{ runner.os }}.zip" .
|
if [ -z "${BIN}" ]; then
|
||||||
|
echo "ERROR: No Linux binary found after build"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "Found: ${BIN}"
|
||||||
|
mkdir -p build_output
|
||||||
|
cp "${BIN}" build_output/ConnectTheCurrent.bin
|
||||||
|
chmod +x build_output/ConnectTheCurrent.bin
|
||||||
|
echo "Executable ready: build_output/ConnectTheCurrent.bin"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Upload Zipped Build Artifact
|
- name: Locate and rename executable (Windows)
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: |
|
||||||
|
Write-Host "Searching for built Windows binary..."
|
||||||
|
Get-ChildItem -Recurse -File -Filter 'ConnectTheCurrent*.exe' | Select-Object -First 1 | ForEach-Object {
|
||||||
|
Write-Host ("Found: " + $_.FullName)
|
||||||
|
New-Item -ItemType Directory -Force -Path build_output | Out-Null
|
||||||
|
Copy-Item $_.FullName "build_output\ConnectTheCurrent.exe"
|
||||||
|
Write-Host "Executable ready: build_output\ConnectTheCurrent.exe"
|
||||||
|
}
|
||||||
|
if (!(Test-Path build_output\ConnectTheCurrent.exe)) {
|
||||||
|
Write-Error "ERROR: No Windows binary found after build"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Connect the Current-${{ runner.os }}.zip
|
name: ${{ matrix.platform }}
|
||||||
path: zip_output/Connect the Current-${{ runner.os }}.zip
|
path: build_output/ConnectTheCurrent.*
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create GitHub Release
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Download All Zipped Builds
|
- name: Download All Build Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
|
|
||||||
- name: Delete Old Release (if exists)
|
- name: Create release (if missing) and upload artifacts to tag
|
||||||
continue-on-error: true
|
|
||||||
run: gh release delete latest -y
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Delete Git tag (if exists)
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
run: |
|
||||||
git push origin :refs/tags/latest
|
set -euo pipefail
|
||||||
git tag -d latest
|
TAG="${{ github.ref_name }}"
|
||||||
|
echo "Target release tag: $TAG"
|
||||||
- name: Recreate Git tag at HEAD
|
if gh release view "$TAG" >/dev/null 2>&1; then
|
||||||
run: |
|
echo "Release $TAG already exists; will upload assets with --clobber"
|
||||||
git tag latest
|
else
|
||||||
git push origin latest
|
gh release create "$TAG" \
|
||||||
|
--title "$TAG" \
|
||||||
- name: Create the new release
|
--notes "Automated build for $TAG"
|
||||||
run: gh release create latest downloads/**/Connect the Current-*.zip --title "Latest Build" --notes "Most recent multi-platform builds of Connect the Current"
|
fi
|
||||||
env:
|
# Upload the executables directly (no zip files)
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
gh release upload "$TAG" downloads/linux/ConnectTheCurrent.bin --clobber
|
||||||
|
gh release upload "$TAG" downloads/windows/ConnectTheCurrent.exe --clobber
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ def get_opposite(direction):
|
|||||||
return "r"
|
return "r"
|
||||||
elif direction == "r":
|
elif direction == "r":
|
||||||
return "l"
|
return "l"
|
||||||
|
|
||||||
elif direction == "t":
|
elif direction == "t":
|
||||||
return "b"
|
return "b"
|
||||||
elif direction == "b":
|
elif direction == "b":
|
||||||
|
|||||||
Reference in New Issue
Block a user