From 5e08b8fcd1e88ff02fe48b99a96329e815ba0963 Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 26 Mar 2021 05:59:52 -0600 Subject: [PATCH 1/5] updates MALCO - renames Puppy option for dailies - properly applies sequence break settings - adjusts weights to make for more friendly dailies on average --- src/main.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main.lua b/src/main.lua index f6bbeec..568500d 100644 --- a/src/main.lua +++ b/src/main.lua @@ -103,7 +103,7 @@ function love.draw() end function generateDaily() - local json = [[{"embeds": [{"title": "**Daily Challenge: %s**","color": 11323851,"fields": [{"name": "Seed","value": "%s","inline": true},{"name": "Version","value": "%s","inline": true},{"name": "Settings","value": "**Objective**: %s\n**Spawn**: %s\n**Puppysanity**: %s\n**Sequence breaks**: %s\n"},{"name": "Title Screen Code","value": "<%s> <%s> <%s> <%s> <%s> (%s/%s/%s/%s/%s)"},{"name": "<:rando:558942498668675072> Sharecode","value": "`%s`"}]}]}]] + local json = [[{"embeds": [{"title": "**Daily Challenge: %s**","color": 11323851,"fields": [{"name": "Seed","value": "%s","inline": true},{"name": "Version","value": "%s","inline": true},{"name": "Settings","value": "**Objective**: %s\n**Spawn**: %s\n**Puppies outside Sand Zone**: %s\n**Sequence breaks**: %s\n"},{"name": "Title Screen Code","value": "<%s> <%s> <%s> <%s> <%s> (%s/%s/%s/%s/%s)"},{"name": "<:rando:558942498668675072> Sharecode","value": "`%s`"}]}]}]] -- no matter what time of day you run the daily, it'll be consistent throughout the day local date = os.date("*t", os.time()) @@ -113,16 +113,25 @@ function generateDaily() local datestring = os.date("%B %d, %Y") local function pick(t) return t[love.math.random(#t)] end - local objective = pick({{name = "Bad Ending", val = "objBadEnd"}, {name = "Normal Ending", val = "objNormalEnd"}, {name = "Best Ending", val = "objBestEnd"}, {name = "All Bosses", val = "objAllBosses"}, {name = "100%", val = "obj100Percent"}}) - local spawn = pick({"Start Point", "Arthur's House", "Camp"}) + local objective = pick({{name = "Bad Ending", val = "objBadEnd"}, {name = "Normal Ending", val = "objNormalEnd"}, {name = "Best Ending", val = "objBestEnd"}, {name = "Bad Ending", val = "objBadEnd"}, {name = "Normal Ending", val = "objNormalEnd"}, {name = "Best Ending", val = "objBestEnd"}, {name = "All Bosses", val = "objAllBosses"}, {name = "100%", val = "obj100Percent"}}) + local spawn = pick({"Start Point", "Arthur's House", "Start Point", "Arthur's House", "Camp"}) local puppies = pick({{name = "Enabled", val = true}, {name = "Disabled", val = false}}) - local sequence = pick({{name = "All", val = true}, {name = "None", val = false}}) + local sequence = pick({{name = "All", val = true}, {name = "None", val = false}, {name = "None", val = false}}) Randomizer.obj = objective.val Randomizer.worldGraph.spawn = spawn Randomizer.puppy = puppies.val Randomizer.worldGraph.seqbreak = sequence.val + Randomizer.worldGraph.dboosts.cthulhu.enabled = sequence.val + Randomizer.worldGraph.dboosts.chaco.enabled = sequence.val + Randomizer.worldGraph.dboosts.paxChaco.enabled = sequence.val + Randomizer.worldGraph.dboosts.flightlessHut.enabled = sequence.val + Randomizer.worldGraph.dboosts.camp.enabled = sequence.val + Randomizer.worldGraph.dboosts.sisters.enabled = sequence.val + Randomizer.worldGraph.dboosts.plantation.enabled = sequence.val + Randomizer.worldGraph.dboosts.rocket.enabled = sequence.val + -- reinitialize seed after pick()ing local seed = Randomizer:_seedRngesus() Randomizer:_updateSharecode(seed) From f7ff04ac794a463240a6cd6bc0ad921d200e39da Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 7 Jan 2022 19:53:34 -0600 Subject: [PATCH 2/5] convert MALCO to github actions --- .github/workflows/daily.yaml | 39 +++++++++++++++++++++++++++++ .gitlab-ci.yml | 23 ----------------- .travis.yml | 48 ------------------------------------ daily.sh | 9 ------- 4 files changed, 39 insertions(+), 80 deletions(-) create mode 100644 .github/workflows/daily.yaml delete mode 100644 .gitlab-ci.yml delete mode 100644 .travis.yml delete mode 100644 daily.sh diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml new file mode 100644 index 0000000..bf8ec2d --- /dev/null +++ b/.github/workflows/daily.yaml @@ -0,0 +1,39 @@ +name: MALCO's Daily Challenge + +on: + schedule: + - cron: '53 15 * * *' # 9:53 AM, UTC-6 + +jobs: + Build: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + os: + - ubuntu-18.04 + steps: + - uses: leafo/gh-actions-lua@v8.0.0 + - uses: leafo/gh-actions-luarocks@v4.0.0 + with: + luarocksVersion: 3.0 + - uses: actions/checkout@v2 + - name: Install dependencies (Ubuntu) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libzip-dev xvfb + sudo add-apt-repository -y ppa:bartbes/love-stable + sudo apt-get -q update + sudo apt-get -y install love + luarocks install --server="http://luarocks.org/dev" lua-zip + luarocks install love-release + - name: Generate Daily + if: github.event_name == 'schedule' + env: + WEBHOOK: ${{ secrets.WEBHOOK }} + run: | + cd src + love-release + sudo xvfb-run -a --server-args="-screen 0 1024x768x24" love "releases/CaveStoryRandomizer.love" --daily + cat daily.txt + curl -H "Content-Type: application/json" -X POST -d @daily.txt "$WEBHOOK" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 9f8388e..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -# image: shru/arch-love-release:heavy -image: asmfreak/love-release:latest - -variables: - ITCHIO_USER: shru - ITCHIO_GAME: cave-story-randomizer - CHANNEL: $CI_COMMIT_REF_NAME - -stages: - - build-release - -build-and-release: - stage: build-release - when: manual - script: - # I - Build - - cd src - - love-release -W - # II - Release to itch.io - - cd releases - - FILE=$(ls *-win32.zip) ; - zip -d "$FILE" "*/lovec.exe" "*/changes.txt" "*/readme.txt" "*.ico" ; - butler push "$FILE" "$ITCHIO_USER/$ITCHIO_GAME:win32-$CHANNEL" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e5e0b7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: python -os: linux -dist: xenial -addons: - apt: - update: true - packages: - - libzip-dev - - xvfb -services: - - xvfb -before_install: - - | - pip install hererocks - hererocks env --luarocks 3.0 --lua latest - export 'PATH='"$TRAVIS_BUILD_DIR"'/env/bin'":$PATH" -install: - - | - sudo add-apt-repository -y ppa:bartbes/love-stable - sudo apt-get -q update - sudo apt-get -y install love - luarocks install --server="http://luarocks.org/dev" lua-zip - luarocks install love-release -script: - - bash daily.sh -env: - global: - - secure: DU2Mq4FPbOidv0Go4b+2r5Vy7v0bbQo40ZZPkiwm/6nAJYkwySwVn2DyZGwh/kV4o6ZG0IgtLxPvHiF8lVZptbtkHJTt/GeokwwvsfpHJntPC9jyvXklFkkln9h2AgWrhTmFf+EYE4Mlm7FAjsr/9ZZHCuGn7wDCOBk3g4Zy7eAyKGqpYMN3296eUiZPXWtOAexmbavFI07pmu4ZyJ8K6HMmjd8YSAQpui3zJn/hMTupQm+o5s/ehZ72QnUyjRWdKvLlJCzORrajJxgYXQqLdjXVMcq4kuR4pDRnLdW9XBlAWiHOvj7wlVOUyBq2ZyhkTTNEYiQp+9UsIua1gG0hdLiOGH2ODtrb6NvQIRUfs5jE6xHmw3hQCfIe9itT+SbVQmuuTovM/MQTS/vH7k+AHtnJCGykMjAD6evNi1EkOG5oxrL7xEGPz7lzyVISoz0O4YmMWGF0qIzb68R11+Eo1URFrEUDxZc7F2kMoeAbnTxfiGABrMXrgIN7ReJhfD1z4ik6KwKBFw9AwJfldyb5w0QgqFAkkihqKGp5VbTMR6LeSN0Tq/Ic3QRvLHYt43+eoRXS4d2lvSo/0Nf7FftQPurbLI6c/r9nckwOZmjFicwYJ0Ulrbd46og74FUQZFSMcrVsiXo1PG2yTwu9bUvTBUHWdWh0o2xPpfAHbA05++c= -before_deploy: - - | - cd src; love-release -M; cd - - mv pre-edited-cs "src/releases/Cave Story" - cd src/releases - zip -9 -qur CaveStoryRandomizer-macos.zip "Cave Story" - zip -9 -qr CaveStoryRandomizer-linux.zip "Cave Story" CaveStoryRandomizer.love - cd - - # don't forget to create the windows releases! -deploy: - provider: releases - token: - secure: bMinTly2BOZCNQw625Fz744hvVQlnwZiC6pQZZx1f5evs0gi4TXbqqft5UN3orGgRiNnVnbf2qYC7PnS1LzynHUimdVk8iqfRKz4ADuWXyf9/i1gojzzSAI87lxbGaHxzqjZLtzf1zRonPlY1oj9X3a1eAle6EEAn/Utnm/jqZPhTYm8cMowLWqcVTcDOw1lhBpgsVYdej1wCaq7r2KBDvrqWZCdt8pJ2lcaShJEqmBONDvu9KO+gbNXwmhBAz4bG0DTVFhO459ZNjfNz749eiU7KhbxvFgz7O+j8HEdhlXznYgmzveUmVmhOSe3z037YwCNv+2ar0FITGkmTpgog0z2XuxDMb28Eakoc0uzaowwB68JRfEeRpBGidhSGraZ5DnHOS3QdDaEQ4jImv97DagiVoqcKm3JDGhGuvbI4dfPsXHKMncJC8cqf86NwSg63boabcoUTwzVLZdd4tbiOBqYPBgEtEz4uFgKvkrrzE0DoP1Efi1aZqcnOW6xckHbC261rxB5QG8WGcb1tDnmQgbhbEEguPHuzKBWP6ktpjpFdeS3Wbqb0UMaXQXMCcaMpJfCLNsLxQ6iHOh+XQhJREDPTuXm4F1m0BzSjBvQpWQ4tpO+kF1KiJ4wiwzn9jTfJxhgMgxEoY75dtH+E0K2jXLRezychR22V+7R9ifNLns= - file: - - src/releases/*.zip - file_glob: true - draft: true - skip_cleanup: true - on: - tags: true diff --git a/daily.sh b/daily.sh deleted file mode 100644 index b8901eb..0000000 --- a/daily.sh +++ /dev/null @@ -1,9 +0,0 @@ -set -ev - -if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then exit 0; fi - -cd src -love-release -sudo xvfb-run -a --server-args="-screen 0 1024x768x24" love "releases/CaveStoryRandomizer.love" --daily -cat daily.txt -curl -H "Content-Type: application/json" -X POST -d @daily.txt "$WEBHOOK" \ No newline at end of file From f7190478cdc5817fedecd2074f86ce0329faf41b Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 7 Jan 2022 19:56:58 -0600 Subject: [PATCH 3/5] i am a fool --- .github/workflows/{daily.yaml => daily.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{daily.yaml => daily.yml} (100%) diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yml similarity index 100% rename from .github/workflows/daily.yaml rename to .github/workflows/daily.yml From c1d39f7296a530074d9e515d14bf6d2690cebfcf Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 7 Jan 2022 20:11:45 -0600 Subject: [PATCH 4/5] allow manual daily workflow calls --- .github/workflows/daily.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index bf8ec2d..02ff933 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -3,6 +3,7 @@ name: MALCO's Daily Challenge on: schedule: - cron: '53 15 * * *' # 9:53 AM, UTC-6 + workflow_dispatch: jobs: Build: @@ -28,7 +29,6 @@ jobs: luarocks install --server="http://luarocks.org/dev" lua-zip luarocks install love-release - name: Generate Daily - if: github.event_name == 'schedule' env: WEBHOOK: ${{ secrets.WEBHOOK }} run: | From ad204a3bc78234f183a4aab575b9ae060c772850 Mon Sep 17 00:00:00 2001 From: duncathan Date: Fri, 7 Jan 2022 20:25:18 -0600 Subject: [PATCH 5/5] explicitly run MALCO on the stable branch --- .github/workflows/daily.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 02ff933..e5f6e8a 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -18,6 +18,8 @@ jobs: with: luarocksVersion: 3.0 - uses: actions/checkout@v2 + with: + ref: 'stable' - name: Install dependencies (Ubuntu) if: runner.os == 'Linux' run: | @@ -32,6 +34,7 @@ jobs: env: WEBHOOK: ${{ secrets.WEBHOOK }} run: | + cd $GITHUB_WORKSPACE cd src love-release sudo xvfb-run -a --server-args="-screen 0 1024x768x24" love "releases/CaveStoryRandomizer.love" --daily