diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml new file mode 100644 index 000000000..b9ece9f23 --- /dev/null +++ b/.github/actions/setup-haxeshit/action.yml @@ -0,0 +1,22 @@ +name: setup-haxeshit +description: "sets up haxe shit, using HMM!" +runs: + using: "composite" + steps: + - uses: krdlab/setup-haxe@v1.1.6 + with: + haxe-version: 4.2.4 + - uses: actions/cache@v3 + with: + path: .haxelib/ + key: ${{ runner.os }}-${{ hashFiles('**/hmm.json') }} + - name: Config haxelib + run: | + haxelib config + shell: bash + - name: Installing Haxe lol + run: | + haxe -version + haxelib --global install hmm + haxelib --global run hmm install --quiet + shell: bash \ No newline at end of file diff --git a/.github/actions/upload-itch/action.yml b/.github/actions/upload-itch/action.yml new file mode 100644 index 000000000..5abc31b16 --- /dev/null +++ b/.github/actions/upload-itch/action.yml @@ -0,0 +1,44 @@ +name: upload-itch +description: "installs Butler, and uploads to itch.io!" +inputs: + butler-key: + description: "Butler API secret key" + required: true + build-dir: + description: "Directory of the game build" + required: true + target: + description: "Target (html5, win, linux, mac)" + required: true +runs: + using: "composite" + steps: + - name: Install butler Windows + if: runner.os == 'Windows' + run: | + curl -L -o butler.zip https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default + 7z x butler.zip + ./butler -v + shell: bash + - name: Install butler Mac + if: runner.os == 'macOS' + run: | + curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default + unzip butler.zip + ./butler -V + shell: bash + - name: Install butler Linux + if: runner.os == 'Linux' + run: | + curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default + unzip butler.zip + chmod +x butler + ./butler -V + shell: bash + - name: Upload game to itch.io + env: + BUTLER_API_KEY: ${{inputs.butler-key}} + run: | + ./butler login + ./butler push ${{inputs.build-dir}} ninja-muffin24/funkin-secret:${{inputs.target}}-${GITHUB_REF##*/} + shell: bash \ No newline at end of file diff --git a/.github/workflows/build-html5-onLinux.yml b/.github/workflows/build-html5-onLinux.yml deleted file mode 100644 index d57843667..000000000 --- a/.github/workflows/build-html5-onLinux.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: build-upload-html5 -on: [push] -jobs: - create-nightly-html5: - runs-on: ubuntu-latest - steps: - - uses: ninjamuffin99/action-hmm-setup@v1 - - name: Setting up linux - run: | - haxelib run lime setup linux - - name: Build game? - run: | - haxelib run lime build html5 -debug -clean - ls - - name: Install butler and shit - run: | - curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default - unzip butler.zip - chmod +x butler - ./butler -V - - name: Upload game to itch.io - env: - BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY}} - run: | - ./butler login - ./butler push export/debug/html5/bin ninja-muffin24/funkin-secret:html5-${GITHUB_REF##*/} - diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml new file mode 100644 index 000000000..abbacc7d3 --- /dev/null +++ b/.github/workflows/build-shit.yml @@ -0,0 +1,63 @@ +name: build-upload +on: [push, workflow_dispatch] +jobs: + create-nightly-html5: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-haxeshit + - name: Build game? + run: | + haxelib run lime build html5 -debug + ls + - uses: ./.github/actions/upload-itch + with: + butler-key: ${{ secrets.BUTLER_API_KEY}} + build-dir: export/debug/html5/bin + target: html5 + create-nightly-win: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-haxeshit + - name: Build game + run: | + haxelib run lime build windows -debug + dir + - uses: ./.github/actions/upload-itch + with: + butler-key: ${{ secrets.BUTLER_API_KEY}} + build-dir: export/debug/windows/bin + target: win + create-nightly-mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-haxeshit + - name: Build game? + run: | + haxelib run lime build mac -debug + ls + - uses: ./.github/actions/upload-itch + with: + butler-key: ${{ secrets.BUTLER_API_KEY}} + build-dir: export/debug/macos/bin + target: mac + create-nightly-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-haxeshit + - name: Setting up Linux + run: | + haxelib run lime setup linux + - name: Build game? + run: | + haxelib run lime build linux -debug + ls + - uses: ./.github/actions/upload-itch + with: + butler-key: ${{ secrets.BUTLER_API_KEY}} + build-dir: export/debug/linux/bin + target: linux +