Skip to content

Commit

Permalink
Automatic updates. Fix ios binary name. (#228)
Browse files Browse the repository at this point in the history
- Fixes #209
- Fixes #227
  • Loading branch information
Ughuuu authored Aug 27, 2024
1 parent 2999a5e commit 68bad1e
Show file tree
Hide file tree
Showing 48 changed files with 1,460 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/godot_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Update plugin.cfg
shell: sh
run: |
sed -i "s/<flavour>/godot-rapier-2d-${{ matrix.precision }}-${{ matrix.features }}/g" bin2d/addons/godot-rapier2d/plugin.cfg
sed -i "s/<flavour>/godot-rapier-3d-${{ matrix.precision }}-${{ matrix.features }}/g" bin3d/addons/godot-rapier3d/plugin.cfg
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- name: Copy to bin
shell: sh
run: |
mv target/release/libgodot_rapier.dylib bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/libgodot_rapier.ios.framework/libgodot_rapier.ios.dylib
mv target/release/libgodot_rapier.dylib bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/libgodot_rapier.ios.framework/libgodot_rapier.ios
- name: Upload
uses: actions/upload-artifact@v4
with:
name: godot-rapier-${{ matrix.dimensions.short }}-${{ matrix.precision }}-${{ matrix.features.name }}-${{ matrix.arch}}
path: |
bin${{ matrix.dimensions.short }}/**/*.dylib
bin${{ matrix.dimensions.short }}/**/*.ios
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
contents: write
needs: [merge]
uses: ./.github/workflows/release.yml
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'

deploy:
name: Deploy Release to Godot Asset Library
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v0.7.27

* Add functions to get objects positions in bulk by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/188
* Fix teleport ruining mass properties by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/190
* fix set_pos_and_velocity of fluid by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/196
* Fix area not detected issue by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/197
* add experimental threads for now to fix wrong thread access by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/198
* add stub functions by @Ughuuu in https://github.com/appsinacup/godot-rapier-physics/pull/199

## v0.7.26

- Fix areas removed issue by [@Ughuuu](https://github.com/Ughuuu) in [#187](https://github.com/appsinacup/godot-rapier-physics/pull/187)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libgodot_rapier.ios.dylib</string>
<string>libgodot_rapier.ios</string>
<key>CFBundleName</key>
<string>Godot Rapier2D</string>
<key>CFBundleDisplayName</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func _check_for_updater():
func show_update() -> void:
message_h4("\n\n\nRequest release infos ... [img=24x24]%s[/img]" % spinner_icon, Color.SNOW)
popup_centered_ratio(.5)
prints("Scanning for %s Update ..." % config.plugin_name)
var content :String

var response: HttpClient.HttpResponse = await _http_client.request_releases()
Expand Down Expand Up @@ -101,9 +100,14 @@ static func extract_latest_version(response: HttpClient.HttpResponse) -> SemVer:
var body :Array = response.response()
return SemVer.parse(body[0]["name"])

static func extract_zip_url(response: HttpClient.HttpResponse) -> String:
var body :Array = response.response()
return body[0]["zipball_url"]
func extract_current_flavour() -> String:
var config_file = ConfigFile.new()
config_file.load('addons/%s/plugin.cfg' % config.plugin_name)
return config_file.get_value('plugin', 'flavour')

func extract_zip_url(response: HttpClient.HttpResponse) -> String:
var flavour := extract_current_flavour()
return 'https://github.com/%s/releases/download/%s/%s.zip' % [config.github_repo, _latest_version, flavour]

func extract_releases(response: HttpClient.HttpResponse, current_version) -> String:
await get_tree().process_frame
Expand Down Expand Up @@ -142,15 +146,12 @@ func _skip_update():
UpdaterConfig.save_skip_config(skip_config)

func _on_update_pressed():
hide()
_update_button.set_disabled(true)

#TODO: How do I give the plugins a hook to perform actions before updating?

#TODO: Perform the update, maybe use the simpler approach from the dialog plugin
var updater_http_request = HTTPRequest.new()
updater_http_request.accept_gzip = true
add_child(updater_http_request)
message_h4("\n\n\nStaring download %s ... [img=24x24]%s[/img]" % [_download_zip_url, spinner_icon], Color.SNOW)

updater_http_request.request_completed.connect(_on_http_request_request_completed)
updater_http_request.request(_download_zip_url)
Expand All @@ -159,6 +160,7 @@ func _on_http_request_request_completed(result: int, response_code: int, headers
if result != HTTPRequest.RESULT_SUCCESS:
message_h4("\n\n\nError downloading update!", Color.RED)
return
message_h4("\n\n\nSuccesfuly downloaded release. Saving file to user://temp.zip", Color.SNOW)

# Save the downloaded zip
var zip_file: FileAccess = FileAccess.open(TEMP_FILE_NAME, FileAccess.WRITE)
Expand All @@ -176,7 +178,7 @@ func _on_http_request_request_completed(result: int, response_code: int, headers
files.remove_at(0)
# Remove assets folder
files.remove_at(0)

for path in files:
var new_file_path: String = path.replace(base_path, "")
if path.ends_with("/"):
Expand All @@ -189,8 +191,8 @@ func _on_http_request_request_completed(result: int, response_code: int, headers
DirAccess.remove_absolute(TEMP_FILE_NAME)

updated.emit()

#TODO: Show that we successfully updated
print("Finished Updating.")
hide()

func _on_close_pressed():
hide()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ theme_override_constants/margin_bottom = 4
[node name="header" type="Label" parent="Panel/GridContainer/PanelContainer"]
layout_mode = 2
size_flags_horizontal = 9
text = "Current version 'v0.7.27'. A new version 'v0.8.0' is available"
text = "Current version 'v0.7.20'. A new version 'v0.8.0' is available"

[node name="PanelContainer2" type="PanelContainer" parent="Panel/GridContainer"]
layout_mode = 2
Expand Down
5 changes: 3 additions & 2 deletions bin2d/addons/godot-rapier2d/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name="Godot Rapier 2D"
description="A 2D and 3D drop-in replacement for the Godot engine that adds stability and fluids."
author="ughuuu"
version="0.8.0"
author="appsinacup"
version="0.8.1"
script="plugin.gd"
flavour="<flavour>"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libgodot_rapier.ios.dylib</string>
<string>libgodot_rapier.ios</string>
<key>CFBundleName</key>
<string>Godot Rapier3D</string>
<key>CFBundleDisplayName</key>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ddxpytkht0m5p"
path="res://.godot/imported/Progress1.svg-0b332643565f056defca50271035ff5f.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/godot-rapier3d/generated/updater/assets/Progress1.svg"
dest_files=["res://.godot/imported/Progress1.svg-0b332643565f056defca50271035ff5f.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dowca7ike2thl"
path="res://.godot/imported/Progress2.svg-63481703eac1538805fd27a6cd7aa2df.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/godot-rapier3d/generated/updater/assets/Progress2.svg"
dest_files=["res://.godot/imported/Progress2.svg-63481703eac1538805fd27a6cd7aa2df.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cwh8md6qipmdw"
path="res://.godot/imported/Progress3.svg-3192e7faf7f63dc2fae3cd132e44d749.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/godot-rapier3d/generated/updater/assets/Progress3.svg"
dest_files=["res://.godot/imported/Progress3.svg-3192e7faf7f63dc2fae3cd132e44d749.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dm0jpqdjetv2c"
path="res://.godot/imported/Progress4.svg-49d57b9a26188090729d3ef08c8b1e81.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/godot-rapier3d/generated/updater/assets/Progress4.svg"
dest_files=["res://.godot/imported/Progress4.svg-49d57b9a26188090729d3ef08c8b1e81.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bkj6kjyjyi7cd"
path="res://.godot/imported/Progress5.svg-c9413815fb239fd6212004da635a591e.ctex"
metadata={
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/godot-rapier3d/generated/updater/assets/Progress5.svg"
dest_files=["res://.godot/imported/Progress5.svg-c9413815fb239fd6212004da635a591e.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 68bad1e

Please sign in to comment.