Skip to content

Commit ad721b5

Browse files
committed
fix push doc link
1 parent 7c60147 commit ad721b5

File tree

7 files changed

+309
-10
lines changed

7 files changed

+309
-10
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Build and package manager for Orix
22

3+
## First install
4+
5+
```bash
6+
mkdir ~/bin/
7+
curl -o ~/bin/bpm https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/src/bpm
8+
export PATH=$PATH:~/bin/
9+
chmod +x ~/bin/bpm
10+
curl -o /tmp/bpm.txt https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/requirements.txt
11+
sudo apt install python3-pip
12+
pip install -r /tmp/bpm.txt
13+
```
14+
15+
316
pip install -r requirements.txt
417

518
## First launch

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.1.6
1+
2025.1.7

mkdocs/docs/getting_started.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Getting started
2+
3+
```bash
4+
mkdir ~/bin/
5+
curl -o ~/bin/bpm https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/src/bpm
6+
export PATH=$PATH:~/bin/
7+
chmod +x ~/bin/bpm
8+
curl -o /tmp/bpm.txt https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/requirements.txt
9+
sudo apt install python3-pip
10+
pip install -r /tmp/bpm.txt
11+
```

mkdocs/docs/installation.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
```bash
2+
mkdir ~/bin/
3+
curl -o ~/bin/bpm https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/src/bpm
4+
export PATH=$PATH:~/bin/
5+
chmod +x ~/bin/bpm
6+
curl -o /tmp/bpm.txt https://raw.githubusercontent.com/orix-software/bpm/refs/heads/main/requirements.txt
7+
sudo apt install python3-pip
8+
pip install -r /tmp/bpm.txt
9+
```
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
name: build
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on push event only for all branches
6+
push:
7+
branches: [ main, master, develop ]
8+
#pull_request:
9+
# branches: [ main, master ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
setup-sdk:
17+
runs-on: ubuntu-24.04
18+
19+
steps:
20+
- name: Cache sdk
21+
id: cache-sdk
22+
uses: actions/cache@v3
23+
with:
24+
path: |
25+
cc65/**/*
26+
orix-sdk/**/*
27+
md2hlp/**/*
28+
orix-software/**/*
29+
bpm/**/*
30+
oricutron/**/*
31+
key: ${{ secrets.CACHE_ID }}-orix-sdk
32+
33+
- name: Checkout cc65
34+
if: steps.cache-sdk.outputs.cache-hit != 'true'
35+
uses: actions/checkout@v3
36+
with:
37+
repository: cc65/cc65
38+
path: cc65
39+
40+
- name: Checkout bpm
41+
#if: steps.cache-sdk.outputs.cache-hit != 'true'
42+
uses: actions/checkout@v3
43+
with:
44+
repository: orix-software/bpm
45+
path: bpm
46+
47+
- name: Checkout orix-sdk
48+
if: steps.cache-sdk.outputs.cache-hit != 'true'
49+
uses: actions/checkout@v3
50+
with:
51+
repository: assinie/orix-sdk
52+
path: orix-sdk
53+
54+
- name: Checkout md2hlp
55+
if: steps.cache-sdk.outputs.cache-hit != 'true'
56+
uses: actions/checkout@v3
57+
with:
58+
repository: assinie/md2hlp
59+
path: md2hlp
60+
61+
- name: Compilation CC65
62+
if: steps.cache-sdk.outputs.cache-hit != 'true'
63+
run: make -C cc65 >/dev/null
64+
65+
- name: Prepare environment for orix-sdk
66+
if: steps.cache-sdk.outputs.cache-hit != 'true'
67+
run: |
68+
git clone --no-checkout --depth 1 --single-branch --branch master https://github.com/orix-software/shell orix-software/shell
69+
cd orix-software/shell
70+
git config --local core.sparseCheckout true
71+
echo "src/include" >> .git/info/sparse-checkout
72+
git checkout
73+
cd ../..
74+
git clone --no-checkout --depth 1 --single-branch --branch master https://github.com/orix-software/kernel orix-software/kernel
75+
cd orix-software/kernel
76+
git config --local core.sparseCheckout true
77+
echo "src/include" >> .git/info/sparse-checkout
78+
git checkout
79+
80+
- name: Prepare environment for oricutron
81+
if: steps.cache-sdk.outputs.cache-hit != 'true'
82+
run: |
83+
sudo apt-get install -y xvfb libgtk-3-0 libgtk-3-dev libsdl1.2debian libsdl1.2-dev
84+
git clone https://github.com/pete-gordon/oricutron.git
85+
cd oricutron && make && pwd && cd .. && ls -l && echo ${GITHUB_WORKSPACE}
86+
echo Timeout oricutron : ${secret}.TMOUT_ORICUTRON
87+
88+
- name: Compile orix-sdk
89+
if: steps.cache-sdk.outputs.cache-hit != 'true'
90+
working-directory: orix-sdk
91+
run: mkdir -p build/{lib,bin} && CC65_HOME=${GITHUB_WORKSPACE}/cc65 make lib
92+
93+
- name: Display tools
94+
run: |
95+
PATH=$PATH:${GITHUB_WORKSPACE}/cc65/bin
96+
cc65 -V
97+
ls -lR orix-sdk
98+
ls -l cc65/bin
99+
100+
build:
101+
# The type of runner that the job will run on
102+
needs: setup-sdk
103+
runs-on: ubuntu-24.04
104+
outputs:
105+
version: ${{ steps.job_vars.outputs.VERSION }}
106+
repo_name: ${{ steps.job_vars.outputs.REPO_NAME }}
107+
bpm_found: ${{ steps.bpm_upload.outputs.BPM_FOUND }}
108+
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
- name: Set job variables
113+
id: job_vars
114+
run: |
115+
echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
116+
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT
117+
118+
- name: Install sdk
119+
uses: actions/cache@v3
120+
with:
121+
path: |
122+
cc65/**/*
123+
orix-sdk/**/*
124+
md2hlp/**/*
125+
orix-software/**/*
126+
bpm/**/*
127+
oricutron/**/*
128+
key: ${{ secrets.CACHE_ID }}-orix-sdk
129+
130+
- name: Prepare environment for project
131+
run: |
132+
mkdir ~/bin
133+
cd bpm && pip install -r requirements.txt && cd ..
134+
# cp bpm/src/bpm ~/bin
135+
# chmod 755 ~/bin/bpm && export PATH=$PATH:~/bin
136+
ls -l && ls -l .. && ls -l ~/bin/ && mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../ && mv bpm ../
137+
138+
- name: Compile project
139+
run: |
140+
if [ -f "bpm.tml" ]; then
141+
ls -l ${GITHUB_WORKSPACE}
142+
ls -l ${GITHUB_WORKSPACE}/oricutron
143+
echo "Workspace : ${GITHUB_WORKSPACE}"
144+
CC65_HOME=${GITHUB_WORKSPACE}/../cc65
145+
echo "../bpm/src/bpm" >> $GITHUB_PATH
146+
echo ${GITHUB_WORKSPACE}/../cc65/bin >> $GITHUB_PATH
147+
export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin
148+
chmod 755 ../bpm/src/bpm
149+
echo "/home/runner/work/file/cc65/bin" >> $GITHUB_PATH
150+
echo "Bpm version :"
151+
bpm --force-update --replace-for-new-project -V
152+
bpm --force-update build
153+
else
154+
CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
155+
fi
156+
157+
- name: Unit-test with oricutron
158+
run: |
159+
echo "Workspace : ${GITHUB_WORKSPACE}"
160+
echo Checking if there is unit tests
161+
if [ -d "tests/build/" ] && [ "$(ls -A tests/build/)" ]; then
162+
echo "########################################################"
163+
echo "# Unit tests found : Starting Oricutron with tests #"
164+
echo "########################################################"
165+
git clone https://github.com/orix-software/docker-unit-test.git
166+
cd docker-unit-test && bash install.sh ${GITHUB_WORKSPACE} && cd ..
167+
echo "Tests found, let's start"
168+
cp tests/build/* > ${GITHUB_WORKSPACE}/oricutron/sdcard/BIN
169+
echo "#!/bin/submit\n" > ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT
170+
cp tests/run.sub >> ${GITHUB_WORKSPACE}/oricutron/sdcard/ETC/AUTOBOOT
171+
cd ${GITHUB_WORKSPACE}/oricutron
172+
echo "Start Oricutron"
173+
timeout --preserve-status 10 ./xvfb.sh || exit 0
174+
fi
175+
176+
- name: Check unit-test
177+
run: |
178+
if [ -d "tests/build/" ] && [ "$(ls -A tests/build/)" ]; then
179+
ls -l ${GITHUB_WORKSPACE}/oricutron/sdcard/
180+
bash tests/unit-tests/verify.sh ${GITHUB_WORKSPACE}/oricutron/sdcard/
181+
fi
182+
183+
- name: List build directory content
184+
run: ls -lR build
185+
186+
- name: Upload Artifact
187+
uses: actions/upload-artifact@v4
188+
with:
189+
name: ${{ steps.job_vars.outputs.REPO_NAME }}
190+
path: |
191+
build/**/*
192+
!build/obj/*
193+
194+
- name: Post compilation
195+
run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .
196+
197+
- name: Upload if bpm
198+
id: bpm_upload
199+
run: |
200+
if [ -f "bpm.tml" ]; then
201+
export BPM_PUBLISH_KEY=$hash
202+
export PATH=$PATH:../bpm/src/:${GITHUB_WORKSPACE}/../cc65/bin
203+
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then bpm --force-update -V;--force-update publish --official; else bpm publish --alpha; fi
204+
echo "BPM_FOUND=True" >> $GITHUB_OUTPUT
205+
fi
206+
207+
upload:
208+
needs: build
209+
runs-on: ubuntu-24.04
210+
defaults:
211+
run:
212+
shell: bash
213+
env:
214+
hash: ${{ secrets.HASH }}
215+
version: ${{ needs.build.outputs.version }}
216+
repo_name: ${{ needs.build.outputs.repo_name }}
217+
BPM_FOUND: ${{ needs.build.outputs.bpm_found }}
218+
219+
steps:
220+
- name: Get branch name
221+
if: github.event_name != 'pull_request'
222+
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
223+
# run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})"
224+
225+
- name: Get branch name on pull request
226+
if: github.event_name == 'pull_request'
227+
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> GITHUB_ENV
228+
#run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
229+
230+
- name: Get archive name
231+
run: echo "ARCHIVE_NAME=${repo_name}.tgz" >> $GITHUB_ENV
232+
233+
# On pourrait faire l'extraction directement à la racine si VERSION est dans l'artifact
234+
- name: Download Artifact
235+
id: download
236+
uses: actions/download-artifact@v4
237+
with:
238+
name: ${{ needs.build.outputs.repo_name }}
239+
path: artifact
240+
241+
- name: Make archive
242+
working-directory: ${{steps.download.outputs.download-path}}
243+
run: |
244+
echo "Use tar for archive"
245+
tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME *
246+
247+
- name: Upload to oric
248+
run: |
249+
echo BPM $BPM_FOUND
250+
if [ "$BPM_FOUND" != "True" ]; then
251+
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha; fi
252+
curl -X POST --data-binary "@${ARCHIVE_NAME}" "https://cdn.oric.org/publish.php?hash=$hash&path=/home/oricoujr/www/ftp/orix/dists/$VERSION/tgz/6502/${ARCHIVE_NAME}"
253+
else
254+
echo "Skipped, already sent with bpm"
255+
fi
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.1
1+
2025.2

src/bpm

+18-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import shutil
1616
import glob
1717
import urllib.parse
1818

19-
VERSION_BPM = "2025.1.6"
19+
VERSION_BPM = "2025.1.7"
2020

2121
main_config_path = os.path.expanduser("~/.bpm/bpm")
2222
folder_path_md2hlp = os.path.expanduser("~/.bpm/md2hlp/")
@@ -676,6 +676,7 @@ def build(args):
676676

677677
arg_include = []
678678
arg_ld_libs = []
679+
arg_include_asm = []
679680

680681
user_folder = os.path.expanduser('~')
681682
reloc_bin_path = f"{user_folder}/.bpm/plugins/orixsdk/{orixsdk_version}/orix-sdk-master/bin/relocbin.py3"
@@ -691,6 +692,8 @@ def build(args):
691692
else:
692693
arg_include.append("-I")
693694
arg_include.append(f"orixlibs/{key}/usr/include/asm/")
695+
arg_include_asm.append("--asm-include-dir")
696+
arg_include_asm.append(f"orixlibs/{key}/usr/include/asm/")
694697
arg_ld_libs.append(f"orixlibs/{key}/usr/share/{key}/{value}/{key}.lib")
695698

696699

@@ -714,6 +717,10 @@ def build(args):
714717
arg_include.append("-I")
715718
arg_include.append(path_orixsdk)
716719

720+
arg_include_asm.append("--asm-include-dir")
721+
arg_include_asm.append(f"{home_directory}/.bpm/plugins/orixsdk/{orixsdk_version}/orix-sdk-master/macros/")
722+
723+
717724

718725
if codetype == "rom":
719726
rom_path = f"build/usr/share/{name}/{version}/"
@@ -768,8 +775,8 @@ def build(args):
768775
bin_cl65 = ['cl65']
769776
arg_cl65 = ['-ttelestrat', file_to_compile_c, "-o", bpm_tmp_folder + '2048', '--start-addr', '2048', "--include-dir", "src/include"]
770777
arg_cl65_2304 = ['-ttelestrat', file_to_compile_c, "-o", bpm_tmp_folder + '2304', '--start-addr', '2304', "--include-dir", "src/include"]
771-
resultat = subprocess.run(bin_cl65 + arg_include + arg_cl65 + arg_ld_libs, check=True, capture_output=False, text=True)
772-
resultat = subprocess.run(bin_cl65 + arg_include + arg_cl65_2304 + arg_ld_libs, check=True, capture_output=False, text=True)
778+
resultat = subprocess.run(bin_cl65 + arg_include_asm + arg_include + arg_cl65 + arg_ld_libs, check=True, capture_output=False, text=True)
779+
resultat = subprocess.run(bin_cl65 + arg_include_asm + arg_include + arg_cl65_2304 + arg_ld_libs, check=True, capture_output=False, text=True)
773780
nom_sans_extension = convert_binary_name_to_seven_chars(nom_sans_extension)
774781
resultat = subprocess.run(["python3" , reloc_bin_path, "-o", bpm_tmp_folder + nom_sans_extension, '-2' ,bpm_tmp_folder + '2048', bpm_tmp_folder + '2304'], check=True, capture_output=False, text=True)
775782
shutil.copy(bpm_tmp_folder + nom_sans_extension, "build/bin/" + nom_sans_extension)
@@ -783,10 +790,11 @@ def build(args):
783790
if os.path.exists(file_to_compile_s):
784791
try:
785792
print(f"Build : {file_to_compile_s}")
786-
arg_cl65 = ['cl65', '-ttelestrat', file_to_compile_s, "-o", bpm_tmp_folder + '2048', '--start-addr', '2048', "--include-dir", "src/include"]
787-
arg_cl65_2304 = ['cl65', '-ttelestrat', file_to_compile_s, "-o", bpm_tmp_folder + '2304', '--start-addr', '2304', "--include-dir", "src/include"]
788-
resultat = subprocess.run(arg_cl65 + arg_include, check=True, capture_output=False, text=True)
789-
resultat = subprocess.run(arg_cl65_2304 + arg_include, check=True, capture_output=False, text=True)
793+
bin_cl65 = ['cl65']
794+
arg_cl65 = ['-ttelestrat', file_to_compile_s, "-o", bpm_tmp_folder + '2048', '--start-addr', '2048', "--include-dir", "src/include"]
795+
arg_cl65_2304 = ['-ttelestrat', file_to_compile_s, "-o", bpm_tmp_folder + '2304', '--start-addr', '2304', "--include-dir", "src/include"]
796+
resultat = subprocess.run(bin_cl65 + arg_include_asm + arg_include + arg_cl65 , check=True, capture_output=False, text=True)
797+
resultat = subprocess.run(bin_cl65 + arg_include_asm + arg_include + arg_cl65_2304 , check=True, capture_output=False, text=True)
790798
resultat = subprocess.run(["python3" , reloc_bin_path, "-o", bpm_tmp_folder + nom_sans_extension, '-2' ,bpm_tmp_folder + '2048', bpm_tmp_folder + '2304'], check=True, capture_output=False, text=True)
791799
shutil.copy(bpm_tmp_folder + nom_sans_extension, "build/bin/" + nom_sans_extension)
792800
print("Built : " + "build/bin/" + nom_sans_extension)
@@ -1285,6 +1293,8 @@ def publish(filename: str, args, mode):
12851293
cpu = conf["package"]["cpu"]
12861294
codetype = conf["package"]["codetype"]
12871295
description = conf["package"]["description"]
1296+
documentation = conf["package"]["documentation"]
1297+
documentation = urllib.parse.quote_plus(documentation)
12881298

12891299
if publish_key is None:
12901300
print("BPM_PUBLISH_KEY is not defined in order to publish on repo.orix.oric.org. To get one, send an email to jede[at]oric[dot]org")
@@ -1298,7 +1308,7 @@ def publish(filename: str, args, mode):
12981308

12991309
if mode == "publish":
13001310
encoded_description = urllib.parse.quote(description)
1301-
url = f"http://api.orix.oric.org/v1/libtgz?cpu={cpu}&repo={repo}&version={version}&name={name}&codetype={codetype}&action={action}&description={encoded_description}&key=" + publish_key
1311+
url = f"http://api.orix.oric.org/v1/libtgz?cpu={cpu}&repo={repo}&version={version}&name={name}&codetype={codetype}&action={action}&description={encoded_description}&documentation={documentation}&key=" + publish_key
13021312
with open(filename, 'rb') as fichier:
13031313
fichiers = {filename: fichier} # Préparer le fichier pour l'envoi
13041314

0 commit comments

Comments
 (0)