Skip to content

Commit

Permalink
feat: Modify docker-build.yml and software_lifecycle.py, and Contribu…
Browse files Browse the repository at this point in the history
…torsList.vue

- Modify docker-build.yml to set up QEMU and enable BuildKit on specific platforms.
- Update software_lifecycle.py to handle exceptions when retrieving the latest beta version from GitHub.
- Update ContributorsList.vue to display 7 backer contributors instead of 6.
  • Loading branch information
realashleybailey committed Oct 4, 2023
1 parent b92ee84 commit 29adb7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up QEMU and enable BuildKit
uses: docker/setup-qemu-action@v1
with:
platforms: all
platforms: linux/amd64,linux/arm64

- name: Log into registry
uses: docker/login-action@v1
Expand Down
15 changes: 9 additions & 6 deletions backend/app/utils/software_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ def get_latest_version():
return parse(response.content.decode("utf-8")) if response.content else None

def get_latest_beta_version():
url = "https://api.github.com/repos/wizarrrr/wizarr/releases"
response = get(url, timeout=10)
if response.status_code != 200:
try:
url = "https://api.github.com/repos/wizarrrr/wizarr/releases"
response = get(url, timeout=5)
if response.status_code != 200:
return None
releases = response.json()
latest_beta = [release["tag_name"] for release in releases if release["prerelease"]][0]
return parse(latest_beta)
except Exception:
return None
releases = response.json()
latest_beta = [release["tag_name"] for release in releases if release["prerelease"]][0]
return parse(latest_beta)

def get_current_version():
package = path.abspath(path.join(path.dirname(__file__), "../", "../", "../", "package.json"))
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/widgets/default/ContributorsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default defineComponent({
.filter((contributor) => contributor.totalAmountDonated! > 0)
.filter((contributor) => contributor.role === "BACKER")
.sort((a, b) => new Date(b.lastTransactionAt!).getTime() - new Date(a.lastTransactionAt!).getTime())
.slice(0, 6)
.slice(0, 7)
.sort((a, b) => b.totalAmountDonated! - a.totalAmountDonated!)
.map((contributor) => (contributor.name === "Guest" ? { ...contributor, name: "Anonymous" } : contributor))
.reduce((acc, contributor) => ((existing) => (existing ? acc.map((item) => (item.profile === contributor.profile ? { ...item } : item)) : [...acc, contributor]))(acc.find((item) => item.profile === contributor.profile)), [] as OpenCollectiveResponse);
Expand Down

0 comments on commit 29adb7f

Please sign in to comment.