Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use sha256 sum #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion recipe/increase_build_number.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
#!/usr/bin/env python

import re
import requests


# read meta.yaml file
with open("recipe/meta.yaml", "r") as f:
text = f.read()

# increase build number
build_number_old = int(re.search(r"(?<={% set build_number = )\d+", text)[0])
build_number_new = build_number_old + 1
print(f"set build_number from build_number {build_number_old} to {build_number_new}")
text = re.sub(r"(?<={% set build_number = )\d+", str(build_number_new), text)

# set sha256sum
url = "https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/freecad_source_sha256sum.txt"
looooo marked this conversation as resolved.
Show resolved Hide resolved
response = requests.get(url)
response.raise_for_status()
sha256 = response.content.decode('utf-8')
print(f"set sha256: {sha256}")
text = re.sub(r"(?<={% set sha256 = )\d+", str(sha256), text)
Copy link
Member

@adrianinsaval adrianinsaval Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this regex here is not correct as it is searching for digits only while the sha256sum also has letters (and looks like it needs quotes surrounding it)


# write meta.yaml file
with open("recipe/meta.yaml", "w") as f:
f.write(text)
f.write(text)
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% set version = "1.1dev" %}
{% set build_number = 34 %}
{% set build_number = build_number + 500 %} # [FEATURE_DEBUG]
{% set sha256 = 65dc32f217a3fe757f5b81bb45dae0cc151c82304e8016ddcc9efbd46fbbc864 %}
looooo marked this conversation as resolved.
Show resolved Hide resolved

package:
name: {{ name }}
Expand All @@ -10,7 +11,7 @@ package:
source:
url: https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/freecad_source.tar.gz
fn: freecad_source_{{ build_number }}.tar.gz
# sha256:
sha256: {{ sha256 }}
patches:
- patches/osx_arm64_cross_compiling.patch # [build_platform != target_platform and osx]

Expand Down
Loading