Skip to content

Commit 027413e

Browse files
ACTION_BOT: Sync version for release (#104)
* WIP: tiny modifcations to tasks for ci * WIP: testing first version of yakbuild ci * WIP-FIX: depracated artifacts fixed * WIP: updated manifest version * WIP: testing versionize * WIP: workin on ci - canoot be tested with act locally since win x1 * WIP: workin on ci - canoot be tested with act locally since win x3 * WIP: workin on ci - canoot be tested with act locally since win x4 * WIP: workin on ci - canoot be tested with act locally since win x5 * WIP: workin on ci - canoot be tested with act locally since win x6 * WIP: workin on ci - canoot be tested with act locally since win x7 * ACTION_BOT: Sync version for release --------- Co-authored-by: Andrea Settimi <andreasettimi39@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent abd6208 commit 027413e

12 files changed

Lines changed: 187 additions & 13 deletions

File tree

.github/workflows/yak-build.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: yak-build
2+
3+
on:
4+
workflow_dispatch: ## DEBUG
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
jobs:
11+
sync-version:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Python and pythonnet
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.9.10'
21+
22+
- name: Install Python dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install invoke
26+
27+
- name: Update the version across the project and commit the changes
28+
run: invoke versionize
29+
30+
- name: Install GitHub CLI
31+
run: |
32+
choco install gh
33+
- name: Authenticate GitHub CLI
34+
run: |
35+
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
36+
37+
- name: Create a new branch and commit the version change
38+
# Delete branch remotely version-sync-branch (if exists)
39+
run: |
40+
git fetch --prune
41+
if git branch -r | grep -q 'origin/version-sync-branch'; then
42+
git push origin --delete version-sync-branch
43+
else
44+
echo "Branch version-sync-branch does not exist."
45+
fi
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
shell: bash
49+
# Create new branch and commit version change
50+
- run: |
51+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
52+
git config --global user.name "github-actions[bot]"
53+
git checkout -b version-sync-branch
54+
git commit -am "ACTION_BOT: Sync version for release"
55+
git push --set-upstream origin version-sync-branch
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
# Close existing pull requests for version-sync-branch
59+
- run: |
60+
gh pr list --state open --head version-sync-branch --json number --jq '.[].number' | ForEach-Object { gh pr close $_ }
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
shell: pwsh
64+
# Create pull request
65+
- run: |
66+
gh pr create --title "ACTION_BOT: Sync version for release" --body "Sync version for release" --base main --head version-sync-branch --label ACTION_BOT
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
# Merge pull request
70+
- run: |
71+
$pr = gh pr list --head version-sync-branch --json number --jq '.[0].number'
72+
gh pr merge $pr --squash --delete-branch --admin
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.DF_COBOT_PAT_TOKEN }}
75+
shell: pwsh
76+
77+
# build-ghusers:
78+
# runs-on: windows-latest
79+
80+
# steps:
81+
# - uses: actions/checkout@v2
82+
83+
# - name: Install Python and pythonnet
84+
# uses: actions/setup-python@v2
85+
# with:
86+
# python-version: '3.9.10'
87+
88+
# - name: Install Python dependencies
89+
# run: |
90+
# python -m pip install --upgrade pip
91+
# pip install invoke
92+
# pip install pythonnet
93+
94+
# - name: Flag the ghuser codes with the correct package version
95+
# run: invoke flagerize
96+
97+
# - name: commit the changes to the repo
98+
# run: git commit -am "Update the version across the project"
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
# - name: Flag the ghuser codes with the correct package version
109+
# run: invoke flagerize
110+
111+
# - name: Build the ghuser components
112+
# run: invoke componentize
113+
114+
# - name: Save artifact the ghuser components
115+
# uses: actions/upload-artifact@v4
116+
# with:
117+
# name: ghuser_components_artifact
118+
119+
# build-yak-package:
120+
# runs-on: windows-latest
121+
122+
# steps:
123+
# - uses: actions/checkout@v2
124+
125+
# - name: Install Python and pythonnet
126+
# uses: actions/setup-python@v2
127+
# with:
128+
# python-version: '3.9.10'
129+
130+
# - name: Install Python dependencies
131+
# run: |
132+
# python -m pip install --upgrade pip
133+
# pip install invoke
134+
# pip install pythonnet
135+
136+
# - name: Update the version across the project
137+
# run: invoke versionize
138+
139+
# - name: Flag the ghuser codes with the correct package version
140+
# run: invoke flagerize
141+
142+
# - name: Build the yak package
143+
# run: invoke yakerize
144+
145+
# - name: Save artifact the yak package as an artifact
146+
# uses: actions/upload-artifact@v4
147+
# with:
148+
# name: yak_package_artifact
149+
# path: build/yak/*.yak

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16.)
2-
project(diffCheck VERSION 0.0.24 LANGUAGES CXX C)
2+
project(diffCheck VERSION 0.0.28 LANGUAGES CXX C)
33
set(CMAKE_CXX_STANDARD 17)
44

55
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

deps/eigen

Submodule eigen updated from c5189ac to 84282c4

invokes/flagerize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def main(
2424
lines = f.readlines()
2525
# check if the line # r: package_name is already in the first 10 lines, erase it
2626
if any([re.search(r"# r: .+==", line) for line in lines[:10]]):
27-
print(f"File {path} is already stamped with the package version.")
27+
print(f"Overwriting file {path}: it was already stamped with the package version.")
2828
lines = [line for line in lines if not re.search(r"# r: .+==", line)]
2929

3030
with open(path, "w") as f:

invokes/versionize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def main(
8888

8989
if __name__ == "__main__":
9090
parser = argparse.ArgumentParser(
91-
description="Update the version number everywhere in code base."
91+
description="Update the version number everywhere in code base, by default taking the reference in the manifest.yml."
9292
)
9393
parser.add_argument(
9494
"--from-manifest",

invokes/yaker/ghio/GH_IO.dll

95 KB
Binary file not shown.
Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ def main(
1515
) -> bool:
1616
current_file_path = os.path.abspath(__file__)
1717
current_directory = os.path.dirname(current_file_path)
18+
build_dir = os.path.abspath(build_dir)
1819

1920
#####################################################################
2021
# Copy manifest, logo, misc folder (readme, license, etc)
2122
#####################################################################
23+
# if not clean build dir, clean it
24+
if os.path.isdir(build_dir):
25+
for f in os.listdir(build_dir):
26+
file_path = os.path.join(build_dir, f)
27+
try:
28+
if os.path.isfile(file_path) or os.path.islink(file_path):
29+
os.unlink(file_path)
30+
elif os.path.isdir(file_path):
31+
shutil.rmtree(file_path)
32+
except Exception as e:
33+
print(f"Failed to delete {file_path}: {e}")
34+
return False
35+
2236
shutil.copy(manifest_path, build_dir)
2337
shutil.copy(logo_path, build_dir)
2438
path_miscdir : str = os.path.join(build_dir, "misc")
@@ -29,21 +43,31 @@ def main(
2943
for f in os.listdir(gh_components_dir):
3044
if f.endswith(".ghuser"):
3145
shutil.copy(os.path.join(gh_components_dir, f), build_dir)
46+
print(f"Copied the manifest, logo, readme, license, and ghuser files to the dir {build_dir}.")
3247

3348
#####################################################################
3449
# Yak exe
3550
#####################################################################
36-
yak_exe_path : str = os.path.join(current_directory, "exec", "Yak.exe")
51+
yak_exe_path : str = os.path.join(current_directory, "yaker", "exec", "Yak.exe")
3752
yak_exe_path = os.path.abspath(yak_exe_path)
53+
if not os.path.isfile(yak_exe_path):
54+
print(f"Yak.exe not found at {yak_exe_path}.")
55+
return False
3856

3957
path_current : str = os.getcwd()
4058
os.chdir(build_dir)
4159
os.system("cd")
60+
4261
try:
4362
os.system(f"{yak_exe_path} build")
4463
except Exception as e:
4564
print(f"Failed to build the yak package: {e}")
4665
return False
66+
67+
if not any([f.endswith(".yak") for f in os.listdir(build_dir)]):
68+
print("No .yak file was created in the build directory.")
69+
return False
70+
4771
os.chdir(path_current)
4872

4973
return True

manifest.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
name: diffCheck
3-
version: 0.0.24
3+
version: 0.0.28
44
authors:
55
- Andrea Settimi
66
- Damien Gilliard
77
- Eleni Skevaki
88
- Marirena Kladeftira
9-
10-
description: diffCheck allows to process point clouds of scans and compare it with a reference model. It is a tool for timber construction, but can be used for other applications as well.
9+
description: diffCheck allows to process point clouds of scans and compare it with a reference model. It has specific benchmark for timber structures and fabrications.
1110
url: https://github.com/diffCheckOrg/diffCheck
1211
keywords:
1312
- Rhino

src/gh/diffCheck/diffCheck/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
__version__ = "0.0.24"
3+
__version__ = "0.0.28"
44

55
# make the dlls available to the python interpreter
66
PATH_TO_DLL = "dlls"

0 commit comments

Comments
 (0)