Skip to content

Commit

Permalink
bugfixes + new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Aug 5, 2024
1 parent 44b2b84 commit 9290865
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 34 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,52 @@ jobs:
name: Build Output
path: ${{ steps.build.outputs.build-output }}

draft:
name: Draft Release
release:
name: Release Version
runs-on: ubuntu-latest
needs: ['package']

steps:
- name: Delete Existing Release
uses: actions/github-script@v7
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = process.env.GITHUB_REPOSITORY.split("/")[0];
const repo = process.env.GITHUB_REPOSITORY.split("/")[1];
const response = await github.rest.repos.listReleases({ owner, repo });
console.log("Checking for existing release...");
for (const release of response.data) {
if (release.tag_name == process.env.COMMIT_MESSAGE) {
console.log("Existing release found, deleting...");
await github.rest.repos.deleteRelease({ owner, repo, release_id: release.id });
await github.rest.git.updateRef({
owner,
repo,
ref: `tags/${release.tag_name}`,
sha: context.sha,
force: true
});
}
}
console.log("Done.");
- name: Find Version
id: version
run: |
curl -s https://raw.githubusercontent.com/${{ github.repository }}/master/mod.json -o mod.json
echo version=$(jq -r .version mod.json) >> $GITHUB_OUTPUT
- name: Check Existing Release
id: check
run: |
RELEASE=$(gh release view ${{ steps.version.outputs.version }} --repo ${{ github.repository }} --json tagName)
if [ -z "$RELEASE" ]; then
echo "No release found for ${{ steps.version.outputs.version }}, continuing with release"
echo release=1 >> $GITHUB_OUTPUT
else
echo "Release found for ${{ steps.version.outputs.version }}, skipping release"
echo release=0 >> $GITHUB_OUTPUT
fi
- name: Find Changelog
if: steps.check.outputs.release == '1'
id: changelog
run: |
curl -s https://raw.githubusercontent.com/${{ github.repository }}/master/changelog.md -o changelog.md
echo changelog=$(awk "/## ${{ steps.version.outputs.version }}/{flag=1; next} /##/{flag=0} flag" changelog.md | sed -e :a -e '/^\n*$/{$d;N;ba}') >> $GITHUB_OUTPUT
- name: Download Build Output
if: steps.check.outputs.release == '1'
uses: actions/download-artifact@v4
with:
name: Build Output
path: build-output

- name: Create Draft Release
- name: Release Version
if: steps.check.outputs.release == '1'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
build-output/*.geode
build-output/*.pdb
tag_name: ${{ github.event.head_commit.message }}
name: ${{ github.event.head_commit.message }}
draft: true
tag_name: ${{ steps.version.outputs.version }}
body: ${{ steps.changelog.outputs.changelog }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(FakeRate VERSION 1.3.1)
project(FakeRate VERSION 1.3.2)

add_library(${PROJECT_NAME} SHARED
src/FakeRate.cpp
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Fake Rate Changelog
## v1.3.2 (2024-08-05)
- Fixed a bug with legacy More Difficulties difficulties not displaying correctly in the fake rate popup
- Fixed a bug with auto levels not displaying difficulty faces correctly in the fake rate popup

## v1.3.1 (2024-07-30)
- Added Grandpa Demon's Infinity sprite
- Adjusted Demons In Between difficulties
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"win": "2.206",
"mac": "2.206"
},
"version": "v1.3.1",
"version": "v1.3.2",
"id": "hiimjustin000.fake_rate",
"name": "Fake Rate",
"developer": "hiimjustin000",
Expand Down
2 changes: 1 addition & 1 deletion src/FREditPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void FREditPopup::updateLabels() {
if (Loader::get()->isModLoaded("uproxide.more_difficulties")) {
if (m_moreDifficultiesOverride == 4 || m_moreDifficultiesOverride == 7 || m_moreDifficultiesOverride == 9) {
m_mdSprite->setDisplayFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(
fmt::format("uproxide.more_difficulties/MD_Difficulty{:02d}.png{}", m_moreDifficultiesOverride, m_legacy ? "_Legacy" : "").c_str()));
fmt::format("uproxide.more_difficulties/MD_Difficulty{:02d}{}.png", m_moreDifficultiesOverride, m_legacy ? "_Legacy" : "").c_str()));
m_mdSprite->setPosition(m_difficultySprite->getPosition() + (m_legacy ? CCPoint { 0.0f, 0.0f } : CCPoint { 0.25f, -0.1f }));
m_mdSprite->setVisible(true);
m_difficultySprite->setOpacity(0);
Expand Down
1 change: 1 addition & 0 deletions src/FakeRate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ int FakeRate::getBaseCurrency(int stars) {

int FakeRate::getDifficultyFromLevel(GJGameLevel* level) {
if (level->m_demon > 0) return level->m_demonDifficulty > 0 ? level->m_demonDifficulty + 4 : 6;
else if (level->m_autoLevel) return -1;
else if (level->m_ratings < 5) return 0;
else return level->m_ratingsSum / level->m_ratings;
}
Expand Down

0 comments on commit 9290865

Please sign in to comment.