From 0f8af2ca504d27e33ffb0078da87e45f0b7d0284 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 18 Jan 2024 22:08:01 -0500 Subject: [PATCH 01/10] Switch branches for HaxeUI-Flixel --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 7e17f105c..cd3a9063c 100644 --- a/hmm.json +++ b/hmm.json @@ -61,7 +61,7 @@ "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "1ec470c297afd7758a90dc9399aa1e3a4ea6ca0b", + "ref": "566872c5c697916ecbb7378808413ef7ed926dd0", "url": "https://github.com/haxeui/haxeui-flixel" }, { From d215152aaff9997179c9c09a2f445f75516433cf Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 18 Jan 2024 22:28:25 -0500 Subject: [PATCH 02/10] Fix a bug where removing audio tracks wouldn't remove their visualizers. --- .../funkin/audio/visualize/PolygonVisGroup.hx | 40 ++++++++++++++++++- .../handlers/ChartEditorAudioHandler.hx | 4 ++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/source/funkin/audio/visualize/PolygonVisGroup.hx b/source/funkin/audio/visualize/PolygonVisGroup.hx index 2903eaccd..cc68f4ae0 100644 --- a/source/funkin/audio/visualize/PolygonVisGroup.hx +++ b/source/funkin/audio/visualize/PolygonVisGroup.hx @@ -8,8 +8,7 @@ class PolygonVisGroup extends FlxTypedGroup { public var playerVis:PolygonSpectogram; public var opponentVis:PolygonSpectogram; - - var instVis:PolygonSpectogram; + public var instVis:PolygonSpectogram; public function new() { @@ -51,6 +50,43 @@ class PolygonVisGroup extends FlxTypedGroup instVis = vis; } + public function clearPlayerVis():Void + { + if (playerVis != null) + { + remove(playerVis); + playerVis.destroy(); + playerVis = null; + } + } + + public function clearOpponentVis():Void + { + if (opponentVis != null) + { + remove(opponentVis); + opponentVis.destroy(); + opponentVis = null; + } + } + + public function clearInstVis():Void + { + if (instVis != null) + { + remove(instVis); + instVis.destroy(); + instVis = null; + } + } + + public function clearAllVis():Void + { + clearPlayerVis(); + clearOpponentVis(); + clearInstVis(); + } + /** * Overrides the add function to add a visualizer to the group. * @param vis The visualizer to add. diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx index d7fbd42c2..f402574fd 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx @@ -223,6 +223,10 @@ class ChartEditorAudioHandler { state.audioVocalTrackGroup.clear(); } + if (state.audioVisGroup != null) + { + state.audioVisGroup.clearAllVis(); + } } /** From 9adfd0b6f16dd3e3f016431851edd489be30bede Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Fri, 19 Jan 2024 21:02:43 -0700 Subject: [PATCH 03/10] Vocal offset is now properly taken into account when playing a song --- .../ui/debug/charting/ChartEditorState.hx | 57 +++++++++++++++++++ .../handlers/ChartEditorAudioHandler.hx | 4 +- .../toolboxes/ChartEditorMetadataToolbox.hx | 7 ++- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index c9f1e4137..27a899aef 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1395,6 +1395,46 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return currentSongMetadata.artist = value; } + /** + * Convenience property to get the player charId for the current variation. + */ + var currentPlayerChar(get, set):String; + + function get_currentPlayerChar():String + { + if (currentSongMetadata.playData.characters.player == null) + { + // Initialize to the default value if not set. + currentSongMetadata.playData.characters.player = Constants.DEFAULT_CHARACTER; + } + return currentSongMetadata.playData.characters.player; + } + + function set_currentPlayerChar(value:String):String + { + return currentSongMetadata.playData.characters.player = value; + } + + /** + * Convenience property to get the opponent charId for the current variation. + */ + var currentOpponentChar(get, set):String; + + function get_currentOpponentChar():String + { + if (currentSongMetadata.playData.characters.opponent == null) + { + // Initialize to the default value if not set. + currentSongMetadata.playData.characters.opponent = Constants.DEFAULT_CHARACTER; + } + return currentSongMetadata.playData.characters.opponent; + } + + function set_currentOpponentChar(value:String):String + { + return currentSongMetadata.playData.characters.opponent = value; + } + /** * Convenience property to get the song offset data for the current variation. */ @@ -1430,6 +1470,23 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return value; } + var currentVocalOffset(get, set):Float; + + function get_currentVocalOffset():Float + { + // Currently there's only one vocal offset, so we just grab the player's offset since both should be the same. + // Should probably make it so we can set offsets for player + opponent individually, though. + return currentSongOffsets.getVocalOffset(currentPlayerChar); + } + + function set_currentVocalOffset(value:Float):Float + { + // Currently there's only one vocal offset, so we just apply it to both characters. + currentSongOffsets.setVocalOffset(currentPlayerChar, value); + currentSongOffsets.setVocalOffset(currentOpponentChar, value); + return value; + } + /** * The variation ID for the difficulty which is currently being edited. */ diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx index d7fbd42c2..0764d7af3 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorAudioHandler.hx @@ -190,7 +190,7 @@ class ChartEditorAudioHandler state.audioVisGroup.playerVis.detail = 1; state.audioVisGroup.playerVis.y = Math.max(state.gridTiledSprite?.y ?? 0.0, ChartEditorState.GRID_INITIAL_Y_POS - ChartEditorState.GRID_TOP_PAD); - state.audioVocalTrackGroup.playerVoicesOffset = state.currentSongOffsets.getVocalOffset(charId); + state.audioVocalTrackGroup.playerVoicesOffset = state.currentVocalOffset; return true; case DAD: state.audioVocalTrackGroup.addOpponentVoice(vocalTrack); @@ -202,7 +202,7 @@ class ChartEditorAudioHandler state.audioVisGroup.opponentVis.detail = 1; state.audioVisGroup.opponentVis.y = Math.max(state.gridTiledSprite?.y ?? 0.0, ChartEditorState.GRID_INITIAL_Y_POS - ChartEditorState.GRID_TOP_PAD); - state.audioVocalTrackGroup.opponentVoicesOffset = state.currentSongOffsets.getVocalOffset(charId); + state.audioVocalTrackGroup.opponentVoicesOffset = state.currentVocalOffset; return true; case OTHER: diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index 06b20ed7c..c69ed9ddf 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -150,7 +150,12 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox inputOffsetVocal.onChange = function(event:UIEvent) { if (event.value == null) return; - chartEditorState.currentSongMetadata.offsets.setVocalOffset(chartEditorState.currentSongMetadata.playData.characters.player, event.value); + chartEditorState.currentVocalOffset = event.value; + if (chartEditorState.audioVocalTrackGroup != null) + { + chartEditorState.audioVocalTrackGroup.playerVoicesOffset = event.value; + chartEditorState.audioVocalTrackGroup.opponentVoicesOffset = event.value; + } }; inputScrollSpeed.onChange = function(event:UIEvent) { var valid:Bool = event.target.value != null && event.target.value > 0; From a7e9f08e2659ca879da757788ad61b039613e680 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Fri, 19 Jan 2024 21:24:18 -0700 Subject: [PATCH 04/10] Editor now loads saved inst/vocal offset properly. --- source/funkin/play/song/Song.hx | 1 + .../ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 089eb6c92..0434607f3 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -235,6 +235,7 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry Date: Mon, 22 Jan 2024 23:51:13 -0700 Subject: [PATCH 05/10] Editor: Removed side sliders. Split vocal volume into two sliders. Removed vocal volume from the savefile. --- source/funkin/save/Save.hx | 39 +------ .../ui/debug/charting/ChartEditorState.hx | 107 +++++------------- 2 files changed, 31 insertions(+), 115 deletions(-) diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index c68caad5f..6a4dd048c 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -108,10 +108,7 @@ abstract Save(RawSaveData) metronomeVolume: 1.0, hitsoundsEnabledPlayer: true, hitsoundsEnabledOpponent: true, - themeMusic: true, - instVolume: 1.0, - voicesVolume: 1.0, - playbackSpeed: 1.0, + themeMusic: true }, }; } @@ -365,40 +362,6 @@ abstract Save(RawSaveData) return this.optionsChartEditor.themeMusic; } - public var chartEditorInstVolume(get, set):Float; - - function get_chartEditorInstVolume():Float - { - if (this.optionsChartEditor.instVolume == null) this.optionsChartEditor.instVolume = 1.0; - - return this.optionsChartEditor.instVolume; - } - - function set_chartEditorInstVolume(value:Float):Float - { - // Set and apply. - this.optionsChartEditor.instVolume = value; - flush(); - return this.optionsChartEditor.instVolume; - } - - public var chartEditorVoicesVolume(get, set):Float; - - function get_chartEditorVoicesVolume():Float - { - if (this.optionsChartEditor.voicesVolume == null) this.optionsChartEditor.voicesVolume = 1.0; - - return this.optionsChartEditor.voicesVolume; - } - - function set_chartEditorVoicesVolume(value:Float):Float - { - // Set and apply. - this.optionsChartEditor.voicesVolume = value; - flush(); - return this.optionsChartEditor.voicesVolume; - } - public var chartEditorPlaybackSpeed(get, set):Float; function get_chartEditorPlaybackSpeed():Float diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index c9f1e4137..f74164554 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -106,7 +106,6 @@ import haxe.ui.components.Label; import haxe.ui.components.Button; import haxe.ui.components.NumberStepper; import haxe.ui.components.Slider; -import haxe.ui.components.VerticalSlider; import haxe.ui.components.TextField; import haxe.ui.containers.dialogs.CollapsibleDialog; import haxe.ui.containers.Frame; @@ -723,34 +722,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState return hitsoundsEnabledPlayer || hitsoundsEnabledOpponent; } - /** - * Sound multiplier for vocals and hitsounds on the player's side. - */ - var soundMultiplierPlayer(default, set):Float = 1.0; - - function set_soundMultiplierPlayer(value:Float):Float - { - soundMultiplierPlayer = value; - var vocalTargetVolume:Float = (menubarItemVolumeVocals.value ?? 100.0) / 100.0; - if (audioVocalTrackGroup != null) audioVocalTrackGroup.playerVolume = vocalTargetVolume * soundMultiplierPlayer; - - return soundMultiplierPlayer; - } - - /** - * Sound multiplier for vocals and hitsounds on the opponent's side. - */ - var soundMultiplierOpponent(default, set):Float = 1.0; - - function set_soundMultiplierOpponent(value:Float):Float - { - soundMultiplierOpponent = value; - var vocalTargetVolume:Float = (menubarItemVolumeVocals.value ?? 100.0) / 100.0; - if (audioVocalTrackGroup != null) audioVocalTrackGroup.opponentVolume = vocalTargetVolume * soundMultiplierOpponent; - - return soundMultiplierOpponent; - } - // Auto-save /** @@ -1703,14 +1674,24 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var menubarItemVolumeInstrumental:Slider; /** - * The `Audio -> Vocal Volume` label. + * The `Audio -> Player Volume` label. */ - var menubarLabelVolumeVocals:Label; + var menubarLabelVolumeVocalsPlayer:Label; /** - * The `Audio -> Vocal Volume` slider. + * The `Audio -> Enemy Volume` label. */ - var menubarItemVolumeVocals:Slider; + var menubarLabelVolumeVocalsOpponent:Label; + + /** + * The `Audio -> Player Volume` slider. + */ + var menubarItemVolumeVocalsPlayer:Slider; + + /** + * The `Audio -> Enemy Volume` slider. + */ + var menubarItemVolumeVocalsOpponent:Slider; /** * The `Audio -> Playback Speed` label. @@ -2601,37 +2582,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState performCommand(new SetItemSelectionCommand([], currentSongChartEventData)); } } - - function setupSideSlider(x, y):VerticalSlider - { - var slider = new VerticalSlider(); - slider.allowFocus = false; - slider.x = x; - slider.y = y; - slider.width = NOTE_SELECT_BUTTON_HEIGHT; - slider.height = GRID_SIZE * 4; - slider.pos = slider.max; - slider.tooltip = "Slide to set the volume of sounds on this side."; - slider.zIndex = 110; - slider.styleNames = "sideSlider"; - add(slider); - - return slider; - } - - var sliderY = GRID_INITIAL_Y_POS + 34; - sliderVolumeOpponent = setupSideSlider(GRID_X_POS - 64, sliderY); - sliderVolumePlayer = setupSideSlider(buttonSelectEvent.x + buttonSelectEvent.width, sliderY); - - sliderVolumePlayer.onChange = event -> { - var volume:Float = event.value.toFloat() / 100.0; - soundMultiplierPlayer = volume; - } - - sliderVolumeOpponent.onChange = event -> { - var volume:Float = event.value.toFloat() / 100.0; - soundMultiplierOpponent = volume; - } } /** @@ -2870,15 +2820,17 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%'; }; - menubarItemVolumeVocals.onChange = event -> { + menubarItemVolumeVocalsPlayer.onChange = event -> { var volume:Float = event.value.toFloat() / 100.0; - if (audioVocalTrackGroup != null) - { - audioVocalTrackGroup.playerVolume = volume * soundMultiplierPlayer; - audioVocalTrackGroup.opponentVolume = volume * soundMultiplierOpponent; - } - menubarLabelVolumeVocals.text = 'Voices - ${Std.int(event.value)}%'; - } + if (audioVocalTrackGroup != null) audioVocalTrackGroup.playerVolume = volume; + menubarLabelVolumeVocalsPlayer.text = 'Player - ${Std.int(event.value)}%'; + }; + + menubarItemVolumeVocalsOpponent.onChange = event -> { + var volume:Float = event.value.toFloat() / 100.0; + if (audioVocalTrackGroup != null) audioVocalTrackGroup.opponentVolume = volume; + menubarLabelVolumeVocalsOpponent.text = 'Enemy - ${Std.int(event.value)}%'; + }; menubarItemPlaybackSpeed.onChange = event -> { var pitch:Float = (event.value * 2.0) / 100.0; @@ -5734,7 +5686,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Reapply the volume. var instTargetVolume:Float = menubarItemVolumeInstrumental.value ?? 1.0; - var vocalTargetVolume:Float = menubarItemVolumeVocals.value ?? 1.0; + var vocalPlayerTargetVolume:Float = menubarItemVolumeVocalsPlayer.value ?? 1.0; + var vocalOpponentTargetVolume:Float = menubarItemVolumeVocalsOpponent.value ?? 1.0; if (audioInstTrack != null) { @@ -5743,8 +5696,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } if (audioVocalTrackGroup != null) { - audioVocalTrackGroup.playerVolume = vocalTargetVolume * soundMultiplierPlayer; - audioVocalTrackGroup.opponentVolume = vocalTargetVolume * soundMultiplierOpponent; + audioVocalTrackGroup.playerVolume = vocalPlayerTargetVolume; + audioVocalTrackGroup.opponentVolume = vocalOpponentTargetVolume; } } @@ -5861,9 +5814,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState switch (noteData.getStrumlineIndex()) { case 0: // Player - if (hitsoundsEnabledPlayer) this.playSound(Paths.sound('chartingSounds/hitNotePlayer'), hitsoundVolume * soundMultiplierPlayer); + if (hitsoundsEnabledPlayer) this.playSound(Paths.sound('chartingSounds/hitNotePlayer'), hitsoundVolume); case 1: // Opponent - if (hitsoundsEnabledOpponent) this.playSound(Paths.sound('chartingSounds/hitNoteOpponent'), hitsoundVolume * soundMultiplierOpponent); + if (hitsoundsEnabledOpponent) this.playSound(Paths.sound('chartingSounds/hitNoteOpponent'), hitsoundVolume); } } } From 6cde91fe966bd38972c9394fdc0488988fedef77 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Mon, 22 Jan 2024 23:51:57 -0700 Subject: [PATCH 06/10] New assets commit --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 7e19c4cfa..080f1cac1 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 7e19c4cfa7db57178f03ed4a58a9fd4d2b93dea7 +Subproject commit 080f1cac1c4fc96b1b221b5ac6c1dd893cfeb52b From 90fc1b3962d4b33456c80d425a18705058917113 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 25 Jan 2024 22:46:47 -0500 Subject: [PATCH 07/10] haxeui hmm update to latest --- hmm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index cd3a9063c..4b2885a87 100644 --- a/hmm.json +++ b/hmm.json @@ -54,14 +54,14 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "bb904f8b4b205755a310c23ff25219f9dcd62711", + "ref": "5b2d5b8e7e470cf637953e1369c80a1f42016a75", "url": "https://github.com/haxeui/haxeui-core" }, { "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "566872c5c697916ecbb7378808413ef7ed926dd0", + "ref": "e9f880522e27134b29df4067f82df7d7e5237b70", "url": "https://github.com/haxeui/haxeui-flixel" }, { From 280f84d5d0c0bb22e8e75d04fd8e94b10f53cbec Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 25 Jan 2024 22:52:20 -0500 Subject: [PATCH 08/10] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 080f1cac1..b2f8b6a78 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 080f1cac1c4fc96b1b221b5ac6c1dd893cfeb52b +Subproject commit b2f8b6a780316959d0a79adc6dbf61f9e4ca675f From ca739cee451e04edbb63d20f8a0d5a5154a054dc Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 25 Jan 2024 23:05:54 -0500 Subject: [PATCH 09/10] event.value -> event.value.toFloat() fix --- source/funkin/ui/debug/charting/ChartEditorState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 5bc365f2b..5f526a364 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2890,7 +2890,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState }; menubarItemPlaybackSpeed.onChange = event -> { - var pitch:Float = (event.value * 2.0) / 100.0; + var pitch:Float = (event.value.toFloat() * 2.0) / 100.0; pitch = Math.floor(pitch / 0.25) * 0.25; // Round to nearest 0.25. #if FLX_PITCH if (audioInstTrack != null) audioInstTrack.pitch = pitch; From d6bc8d88aab3e75f33fba85fb75e224731f2a6cf Mon Sep 17 00:00:00 2001 From: Hazel Date: Mon, 29 Jan 2024 19:50:04 +0000 Subject: [PATCH 10/10] fix(ci): checkout, html5 (#305) * fetch-depth=1 * switch to app tokens * docs? * docs! * actions / doesnt check out * mac attempt 1 * custom setup haxe action * trigger ci run thanks github * interesting * meow * use tags * homebrew fixing maybe * mymindishazel/actions-setup-haxe@vC.1.8 * automationgit pushgit pushgit push * rosetta all the way? * macos oopsy * mac cache && move ci to org * update checkout action to do post-checkout cleaning * update haxe & cache actions to node 20 * retry action but with updated ci-checkout@v6 * cleanup: there's no scheduled runs * actions/cache@v4 in setup-haxe * update to haxe 4.3 * lack of libc? * ubuntu 23.10 has glibc 2.38 --------- Co-authored-by: Eric Co-authored-by: Cameron Taylor --- .github/actions/setup-haxeshit/action.yml | 6 +- .github/actions/upload-itch/action.yml | 58 ++++++------- .github/workflows/build-shit.yml | 100 ++++++++-------------- 3 files changed, 67 insertions(+), 97 deletions(-) diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml index ad9c06286..9c1fae0b1 100644 --- a/.github/actions/setup-haxeshit/action.yml +++ b/.github/actions/setup-haxeshit/action.yml @@ -3,9 +3,9 @@ description: "sets up haxe shit, using HMM!" runs: using: "composite" steps: - - uses: funkincrew/ci-haxe@v2 + - uses: funkincrew/ci-haxe@v3 with: - haxe-version: 4.3.1 + haxe-version: 4.3.3 - name: Config haxelib run: | haxelib config @@ -19,7 +19,7 @@ runs: shell: bash - name: dependency install cache id: cache-hmm - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .haxelib key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }} diff --git a/.github/actions/upload-itch/action.yml b/.github/actions/upload-itch/action.yml index 7a4b45427..2f7d3027d 100644 --- a/.github/actions/upload-itch/action.yml +++ b/.github/actions/upload-itch/action.yml @@ -13,32 +13,32 @@ inputs: 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_NAME} - shell: bash + - 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_NAME} + shell: bash diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 301cedcef..76126d106 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -4,56 +4,14 @@ on: push: jobs: - check_date: - runs-on: [self-hosted, linux] - container: ubuntu:latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - name: ensure git cli is installed - run: apt update && apt install sudo git -y - - name: get token from gh app - uses: actions/create-github-app-token@v1 - id: app_token - with: - app-id: ${{ vars.APP_ID }} - private-key: ${{ secrets.APP_PEM }} - owner: ${{ github.repository_owner }} - - name: checkout repo - uses: funkincrew/ci-checkout@v5 - with: - submodules: 'recursive' - token: ${{ steps.app_token.outputs.token }} - - name: check whether submodules exist - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - - # debug output - echo gh=${{ github.sha }} - echo head=$(git rev-parse HEAD) - echo art=$(git -C art rev-parse HEAD) - echo assets=$(git -C assets rev-parse HEAD) - - # checks if HEAD commit hash in submodules is diff from current repo, and therefore exists - test $(git rev-parse HEAD) != $(git -C art rev-parse HEAD) - test $(git rev-parse HEAD) != $(git -C assets rev-parse HEAD) - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" create-nightly-html5: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false'}} runs-on: [self-hosted, linux] - container: ubuntu:latest + container: ubuntu:23.10 steps: - name: prepare container run: | apt update apt install sudo git curl unzip -y - echo $GITHUB_WORKSPACE git config --global --add safe.directory $GITHUB_WORKSPACE - name: get token from gh app uses: actions/create-github-app-token@v1 @@ -63,12 +21,12 @@ jobs: private-key: ${{ secrets.APP_PEM }} owner: ${{ github.repository_owner }} - name: checkout repo - uses: funkincrew/ci-checkout@v5 + uses: funkincrew/ci-checkout@v6 with: submodules: 'recursive' token: ${{ steps.app_token.outputs.token }} - uses: ./.github/actions/setup-haxeshit - - name: game build dependencies + - name: gather game dependencies run: | sudo apt-get install -y libx11-dev xorg-dev libgl-dev libxi-dev libxext-dev libasound2-dev libxinerama-dev libxrandr-dev libgl1-mesa-dev - name: build game @@ -81,12 +39,7 @@ jobs: build-dir: export/release/html5/bin target: html5 create-nightly-win: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false'}} runs-on: windows-latest - permissions: - contents: write - actions: write steps: - name: get token from gh app uses: actions/create-github-app-token@v1 @@ -96,7 +49,7 @@ jobs: private-key: ${{ secrets.APP_PEM }} owner: ${{ github.repository_owner }} - name: checkout repo - uses: funkincrew/ci-checkout@v5 + uses: funkincrew/ci-checkout@v6 with: submodules: 'recursive' token: ${{ steps.app_token.outputs.token }} @@ -106,14 +59,14 @@ jobs: mkdir -p ${{ runner.temp }}\hxcpp_cache - name: Restore build cache id: cache-build-win - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .haxelib export ${{ runner.temp }}\hxcpp_cache key: ${{ runner.os }}-build-win-${{ github.ref_name }}-${{ hashFiles('**/hmm.json') }} - - name: Build game + - name: build game run: | haxelib run lime build windows -release -DNO_REDIRECT_ASSETS_FOLDER dir @@ -125,8 +78,6 @@ jobs: build-dir: export/release/windows/bin target: win create-nightly-mac: - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false'}} runs-on: [self-hosted, macos] steps: - name: prepare container @@ -140,7 +91,7 @@ jobs: private-key: ${{ secrets.APP_PEM }} owner: ${{ github.repository_owner }} - name: checkout repo - uses: funkincrew/ci-checkout@v5 + uses: funkincrew/ci-checkout@v6 with: submodules: 'recursive' token: ${{ steps.app_token.outputs.token }} @@ -148,9 +99,9 @@ jobs: - name: Make HXCPP cache dir run: | mkdir -p ${{ runner.temp }}/hxcpp_cache - - name: Restore build cache + - name: restore build cache id: cache-build-win - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | .haxelib @@ -168,20 +119,39 @@ jobs: butler-key: ${{ secrets.BUTLER_API_KEY}} build-dir: export/release/macos/bin target: macos + # test-unit-win: # needs: create-nightly-win # runs-on: windows-latest -# permissions: -# contents: write -# actions: write # steps: -# - uses: funkincrew/ci-checkout@v5 +# - name: get token from gh app +# uses: actions/create-github-app-token@v1 +# id: app_token # with: -# submodules: 'recursive' -# fetch-depth: 0 -# token: ${{ secrets.GH_RO_PAT }} +# app-id: ${{ vars.APP_ID }} +# private-key: ${{ secrets.APP_PEM }} +# owner: ${{ github.repository_owner }} +# - name: checkout repo +# uses: funkincrew/ci-checkout@v6 +# with: +# submodules: 'recursive' +# token: ${{ steps.app_token.outputs.token }} +# - name: Make HXCPP cache dir +# run: | +# mkdir -p ${{ runner.temp }}\hxcpp_cache +# - name: Restore build cache +# id: cache-build-win +# uses: actions/cache@v4 +# with: +# path: | +# .haxelib +# export +# ${{ runner.temp }}\hxcpp_cache +# key: ${{ runner.os }}-test-win-${{ github.ref_name }}-${{ hashFiles('**/hmm.json') }} # - uses: ./.github/actions/setup-haxeshit # - name: Run unit tests # run: | # cd ./tests/unit/ # ./start-win-native.bat +# env: +# HXCPP_COMPILE_CACHE: "${{ runner.temp }}\\hxcpp_cache"