Skip to content

Commit d05e8cb

Browse files
authored
Merge pull request #86 from orix-software/develop
Develop
2 parents 03cf862 + 3335b20 commit d05e8cb

7 files changed

Lines changed: 209 additions & 88 deletions

File tree

.github/workflow/shell.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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-18.04
18+
19+
steps:
20+
- name: Cache sdk
21+
id: cache-sdk
22+
uses: actions/cache@v2
23+
with:
24+
path: |
25+
cc65/**/*
26+
orix-sdk/**/*
27+
md2hlp/**/*
28+
orix-software/**/*
29+
key: ${{ runner.os }}-orix-sdk_
30+
31+
- name: Checkout cc65
32+
if: steps.cache-sdk.outputs.cache-hit != 'true'
33+
uses: actions/checkout@v2
34+
with:
35+
repository: cc65/cc65
36+
path: cc65
37+
38+
- name: Checkout orix-sdk
39+
if: steps.cache-sdk.outputs.cache-hit != 'true'
40+
uses: actions/checkout@v2
41+
with:
42+
repository: assinie/orix-sdk
43+
path: orix-sdk
44+
45+
- name: Checkout md2hlp
46+
if: steps.cache-sdk.outputs.cache-hit != 'true'
47+
uses: actions/checkout@v2
48+
with:
49+
repository: assinie/md2hlp
50+
path: md2hlp
51+
52+
- name: Compilation CC65
53+
if: steps.cache-sdk.outputs.cache-hit != 'true'
54+
run: make -C cc65 >/dev/null
55+
56+
- name: Prepare environment for orix-sdk
57+
if: steps.cache-sdk.outputs.cache-hit != 'true'
58+
run: |
59+
git clone --no-checkout --depth 1 --single-branch --branch master https://github.com/orix-software/shell orix-software/shell
60+
cd orix-software/shell
61+
git config --local core.sparseCheckout true
62+
echo "src/include" >> .git/info/sparse-checkout
63+
git checkout
64+
cd ../..
65+
git clone --no-checkout --depth 1 --single-branch --branch master https://github.com/orix-software/kernel orix-software/kernel
66+
cd orix-software/kernel
67+
git config --local core.sparseCheckout true
68+
echo "src/include" >> .git/info/sparse-checkout
69+
git checkout
70+
71+
- name: Compile orix-sdk
72+
if: steps.cache-sdk.outputs.cache-hit != 'true'
73+
working-directory: orix-sdk
74+
run: mkdir -p build/{lib,bin} && CC65_HOME=${GITHUB_WORKSPACE}/cc65 make lib
75+
76+
- name: Display tools
77+
run: |
78+
PATH=$PATH:${GITHUB_WORKSPACE}/cc65/bin
79+
cc65 -V
80+
ls -lR orix-sdk
81+
ls -l cc65/bin
82+
83+
build:
84+
# The type of runner that the job will run on
85+
needs: setup-sdk
86+
runs-on: ubuntu-18.04
87+
outputs:
88+
version: ${{ steps.job_vars.outputs.VERSION }}
89+
repo_name: ${{ steps.job_vars.outputs.REPO_NAME }}
90+
91+
steps:
92+
- name: Checkout repository and submodules
93+
uses: actions/checkout@v2
94+
with:
95+
submodules: recursive
96+
97+
- name: Set job variables
98+
id: job_vars
99+
run: |
100+
echo "::set-output name=VERSION::$(cat VERSION)"
101+
echo "::set-output name=REPO_NAME::${GITHUB_REPOSITORY##*/}"
102+
103+
- name: Install sdk
104+
uses: actions/cache@v2
105+
with:
106+
path: |
107+
cc65/**/*
108+
orix-sdk/**/*
109+
md2hlp/**/*
110+
orix-software/**/*
111+
key: ${{ runner.os }}-orix-sdk_
112+
113+
- name: Prepare environment for project
114+
run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../
115+
116+
- name: Compile project
117+
run: CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
118+
119+
- name: List build directory content
120+
run: ls -lR build
121+
122+
- name: Upload Artifact
123+
uses: actions/upload-artifact@v2
124+
with:
125+
name: ${{ steps.job_vars.outputs.REPO_NAME }}
126+
path: |
127+
build/**/*
128+
!build/obj/*
129+
130+
- name: Post compilation
131+
run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .
132+
133+
upload:
134+
needs: build
135+
runs-on: ubuntu-18.04
136+
defaults:
137+
run:
138+
shell: bash
139+
env:
140+
hash: ${{ secrets.HASH }}
141+
version: ${{ needs.build.outputs.version }}
142+
repo_name: ${{ needs.build.outputs.repo_name }}
143+
144+
steps:
145+
- name: Get branch name
146+
if: github.event_name != 'pull_request'
147+
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
148+
# run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})"
149+
150+
- name: Get branch name on pull request
151+
if: github.event_name == 'pull_request'
152+
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> GITHUB_ENV
153+
#run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
154+
155+
- name: Get archive name
156+
run: echo "ARCHIVE_NAME=${repo_name}.tgz" >> $GITHUB_ENV
157+
158+
# On pourrait faire l'extraction directement à la racine si VERSION est dans l'artifact
159+
- name: Download Artifact
160+
id: download
161+
uses: actions/download-artifact@v2
162+
with:
163+
name: ${{ needs.build.outputs.repo_name }}
164+
path: artifact
165+
166+
- name: Make archive
167+
working-directory: ${{steps.download.outputs.download-path}}
168+
run: tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME *
169+
170+
- name: Upload to oric
171+
run: |
172+
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha ; fi
173+
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}"
174+

.github/workflows/shell.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

Makefile

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,26 @@ LDFILES=
66
ROM=shell
77
ORIX_ROM=shell
88

9-
all : build
10-
.PHONY : all
9+
all : init build after_success
10+
.PHONY : all
1111

1212
HOMEDIR=/home/travis/bin/
1313
HOMEDIR_ORIX=/home/travis/build/orix-software/$(ROM)/
1414
ORIX_VERSION=1.0
1515

1616
SOURCE=src/$(ROM).asm
1717

18+
ifeq ($(CC65_HOME),)
19+
CC = cl65
20+
AS = ca65
21+
LD = ld65
22+
AR = ar65
23+
else
24+
CC = $(CC65_HOME)/bin/cl65
25+
AS = $(CC65_HOME)/bin/ca65
26+
LD = $(CC65_HOME)/bin/ld65
27+
AR = $(CC65_HOME)/bin/ar65
28+
endif
1829

1930

2031
ifdef TRAVIS_BRANCH
@@ -32,6 +43,8 @@ endif
3243
TELESTRAT_TARGET_RELEASE=release/telestrat
3344
MYDATE = $(shell date +"%Y-%m-%d %H:%m")
3445

46+
init:
47+
./configure
3548

3649
build: $(SOURCE)
3750
echo Build Kernel for Twilighte board
@@ -54,6 +67,22 @@ test:
5467
#cp src/include/orix.h build/usr/include/orix/
5568

5669

70+
after_success:
71+
ls -l
72+
ls -l ../
73+
mkdir -p build/usr/src/shell/src/
74+
mkdir -p build/usr/share/man/
75+
mkdir -p build/usr/share/fonts/
76+
mkdir -p build/usr/share/shell/
77+
cp data/USR/SHARE/FONTS/* build/usr/share/fonts/ -adpR
78+
cp shellsd.rom build/usr/share/shell/
79+
cp shellus.rom build/usr/share/shell/
80+
sh tools/builddocs.sh
81+
cp Makefile build/usr/src/shell/
82+
cp README.md build/usr/src/shell/
83+
cp src/* build/usr/src/shell/src/ -adpR
84+
85+
5786

5887

5988

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
Github action : ![shell](https://github.com/orix-software/shell/workflows/shell/badge.svg)
2-
3-
Travis : [![Build Status](https://travis-ci.org/orix-software/shell.svg?branch=master)](https://travis-ci.org/orix-software/shell)
1+
Github action : ![shell](https://github.com/orix-software/shell/workflows/main/badge.svg)
42

53
Maintainers :
64

75
* Jede
8-
* Assinie
6+
* Assinie
97

108
# Rules for source code
119

@@ -14,10 +12,8 @@ Maintainers :
1412
* Allocate with malloc your memory. In that case, in the future, it will be easier to start multithreading.
1513
* userzp will be managed by kernel when multithreading occurs
1614

17-
1815
# Shell for Orix (ROM)
1916

20-
2117
How to compile ?
2218

2319
You need to download cc65 lastest version in order to get last telestrat.inc file.

src/build.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.define __DATE__ "2021-05-05 11:14"
1+
.define __DATE__ "2021-07-06 23:06"

tools/builddocs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ LIST_COMMAND='bank basic11 cat cd clear cp date echo env help ioports lscpu ls m
77
echo Generate hlp
88
for I in $LIST_COMMAND; do
99
echo Generate $I
10-
cat $HOMEDIRDOC/$I.md | md2hlp.py -c $HOMEDIRDOC/md2hlp.cfg > build/usr/share/man/$I.hlp
10+
cat $HOMEDIRDOC/$I.md | ../md2hlp/src/md2hlp.py -c $HOMEDIRDOC/md2hlp.cfg > build/usr/share/man/$I.hlp
1111
done

0 commit comments

Comments
 (0)