Skip to content

Commit 5920292

Browse files
authored
Merge pull request #3 from orix-software/develop
Develop
2 parents 0947745 + 17021ef commit 5920292

File tree

4 files changed

+186
-30
lines changed

4 files changed

+186
-30
lines changed

.github/workflows/main.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
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+
- uses: actions/checkout@v2
93+
94+
- name: Set job variables
95+
id: job_vars
96+
run: |
97+
echo "::set-output name=VERSION::$(cat VERSION)"
98+
echo "::set-output name=REPO_NAME::${GITHUB_REPOSITORY##*/}"
99+
100+
- name: Install sdk
101+
uses: actions/cache@v2
102+
with:
103+
path: |
104+
cc65/**/*
105+
orix-sdk/**/*
106+
md2hlp/**/*
107+
orix-software/**/*
108+
key: ${{ runner.os }}-orix-sdk_
109+
110+
- name: Prepare environment for project
111+
run: mv cc65 ../ && mv orix-software ../ && mv orix-sdk ../ && mv md2hlp ../
112+
113+
- name: Compile project
114+
run: CC65_HOME=${GITHUB_WORKSPACE}/../cc65 make
115+
116+
- name: List build directory content
117+
run: ls -lR build
118+
119+
- name: Upload Artifact
120+
uses: actions/upload-artifact@v2
121+
with:
122+
name: ${{ steps.job_vars.outputs.REPO_NAME }}
123+
path: |
124+
build/**/*
125+
!build/obj/*
126+
127+
- name: Post compilation
128+
run: mv ../cc65 . && mv ../orix-software . && mv ../orix-sdk . && mv ../md2hlp .
129+
130+
upload:
131+
needs: build
132+
runs-on: ubuntu-18.04
133+
defaults:
134+
run:
135+
shell: bash
136+
env:
137+
hash: ${{ secrets.HASH }}
138+
version: ${{ needs.build.outputs.version }}
139+
repo_name: ${{ needs.build.outputs.repo_name }}
140+
141+
steps:
142+
- name: Get branch name
143+
if: github.event_name != 'pull_request'
144+
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
145+
# run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})"
146+
147+
- name: Get branch name on pull request
148+
if: github.event_name == 'pull_request'
149+
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> GITHUB_ENV
150+
#run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
151+
152+
- name: Get archive name
153+
run: echo "ARCHIVE_NAME=${repo_name}.tgz" >> $GITHUB_ENV
154+
155+
# On pourrait faire l'extraction directement à la racine si VERSION est dans l'artifact
156+
- name: Download Artifact
157+
id: download
158+
uses: actions/download-artifact@v2
159+
with:
160+
name: ${{ needs.build.outputs.repo_name }}
161+
path: artifact
162+
163+
- name: Make archive
164+
working-directory: ${{steps.download.outputs.download-path}}
165+
run: tar -zcvf $GITHUB_WORKSPACE/$ARCHIVE_NAME *
166+
167+
- name: Upload to oric
168+
run: |
169+
if [ "$BRANCH_NAME" = "master" -o "$BRANCH_NAME" = "main" ]; then VERSION="$version"; else VERSION=alpha ; fi
170+
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}"
171+

.travis.yml

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

Makefile

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ SOURCE=src/file.c
55

66
ASFLAGS=-C -W -e error.txt -l xa_labels.txt
77

8-
ifdef TRAVIS_BRANCH
9-
ifeq ($(TRAVIS_BRANCH), main)
10-
RELEASE:=$(shell cat VERSION)
11-
else
12-
RELEASE=alpha
13-
endif
14-
endif
158

169
ifeq ($(CC65_HOME),)
1710
CC = cl65
@@ -27,21 +20,11 @@ endif
2720

2821

2922
$(PROGRAM): $(SOURCE)
30-
$(CC) -o 800 $(CFLAGS) $(LDFILES) $(SOURCE)
31-
$(CC) -o 900 $(CFLAGS) --config deps/orix-sdk/cfg/telestrat_900.cfg $(LDFILES) $(SOURCE)
23+
mkdir build/bin -p
24+
$(CC) -o build/bin/file $(CFLAGS) $(LDFILES) $(SOURCE)
25+
#$(CC) -o 800 $(CFLAGS) $(LDFILES) $(SOURCE)
26+
#$(CC) -o 900 $(CFLAGS) --config deps/orix-sdk/cfg/telestrat_900.cfg $(LDFILES) $(SOURCE)
3227

3328
# Reloc
34-
python deps/orix-sdk/bin/relocbin.py3 800 900 $(PROGRAM) 3
29+
#python deps/orix-sdk/bin/relocbin.py3 800 900 $(PROGRAM) 3
3530

36-
test:
37-
mkdir -p build/bin/
38-
mkdir -p build/usr/share/man
39-
mkdir -p build/usr/share/ipkg
40-
cp $(PROGRAM) build/bin/
41-
cp src/man/$(PROGRAM).hlp build/usr/share/man
42-
cp src/ipkg/$(PROGRAM).csv build/usr/share/ipkg
43-
cd build && tar -c * > ../$(PROGRAM).tar && cd ..
44-
gzip $(PROGRAM).tar
45-
mv $(PROGRAM).tar.gz $(PROGRAM).tgz
46-
php buildTestAndRelease/publish/publish2repo.php $(PROGRAM).tgz ${hash} 6502 tgz alpha
47-
echo nothing

run.Sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
ORICUTRON_PATH="/mnt/c/Users/plifp/OneDrive/oric/oricutron_wsl/oricutron"
3+
CA65_INC=/usr/share/cc65/asminc/
4+
mkdir build/bin/ -p
5+
cl65 -o build/bin/file -ttelestrat src/file.c
6+
cp build/bin/file $ORICUTRON_PATH/sdcard/bin
7+
cd $ORICUTRON_PATH
8+
./oricutron
9+
cd -
10+

0 commit comments

Comments
 (0)