From 5e7f12ae1b5985158f8b433ffefc60dd5a580602 Mon Sep 17 00:00:00 2001 From: thegamerx1 <34986564+thegamerx1@users.noreply.github.com> Date: Sun, 4 Feb 2024 16:22:11 +0100 Subject: [PATCH] feat: add ci/cd --- .github/workflows/build.yaml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..dcdb079 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,48 @@ +name: Build on Windows +on: push + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Checkout ahk-libs + run: git clone https://github.com/thegamerx1/ahk-libs Lib + + - name: Trust me I hate this + run: |- + New-Item -Path "$HOME\Documents\Autohotkey" -ItemType Directory -Force + Copy-Item -Recurse -Force "$(pwd)\Lib" "$HOME\Documents\Autohotkey\Lib" + # New-Item -ItemType Junction -Path "$HOME\Documents\Autohotkey\Lib" -Target "$(pwd)\Lib" + + - run: choco install autohotkey + - run: Get-ChildItem + - run: Get-ChildItem "$HOME\Documents\Autohotkey\Lib" + - run: Get-ChildItem "." + - run: Get-ChildItem "Lib" + - name: Compile HTML + run: > + & "C:\Program Files\AutoHotkey\AutohotkeyU64.exe" "/ErrorStdOut" "Lib\EzGui\projectCompile.ahk" "$(pwd)\web\index.html" 2>&1 | Out-Host + - name: Compile AHK + run: > + & "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" "/ErrorStdOut" "/in" "main.ahk" 2>&1 | Out-Host + + - run: Get-ChildItem web/minify + - run: Get-ChildItem Lib + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: StartUp.exe + path: StartUp.exe + if-no-files-found: error + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 + with: + files: StartUp.exe \ No newline at end of file