Skip to content

Commit dc728fb

Browse files
authored
Merge pull request #34 from cobaltgit/devel
Hadron to main branch
2 parents 41b631a + 0f7e604 commit dc728fb

1,234 files changed

Lines changed: 9070 additions & 2407 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-cores.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build RetroArch cores
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
artifact-name:
7+
description: "Name of the uploaded cores artifact"
8+
value: ${{ jobs.build-cores.outputs.artifact-name }}
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-cores:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
artifact-name: retroarch-cores-${{ github.sha }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Read core list
22+
id: corelist
23+
run: |
24+
if [ ! -f "scripts/cores.txt" ]; then
25+
echo "scripts/cores.txt not found!"
26+
exit 1
27+
fi
28+
CORES=$(grep -v '^\s*#' scripts/cores.txt | grep -v '^\s*$' | tr '\n' ' ' | xargs)
29+
echo "cores=$CORES" >> $GITHUB_OUTPUT
30+
echo "Building cores: $CORES"
31+
32+
- name: Restore ccache
33+
uses: actions/cache@v5
34+
with:
35+
path: ~/.ccache-retroarch
36+
key: ccache-retroarch-${{ runner.os }}-${{ github.sha }}
37+
restore-keys: |
38+
ccache-retroarch-${{ runner.os }}-
39+
40+
- name: Set up QEMU
41+
uses: docker/setup-qemu-action@v3
42+
43+
- name: Pull builder image
44+
run: docker pull ghcr.io/cobaltgit/quark-core-builder:latest
45+
46+
- name: Build cores
47+
run: |
48+
mkdir -p output
49+
docker run --rm \
50+
-e CORES="${{ steps.corelist.outputs.cores }}" \
51+
-e CCACHE_DIR=/ccache \
52+
-v ${{ github.workspace }}/output:/output \
53+
-v $HOME/.ccache-retroarch:/ccache \
54+
ghcr.io/cobaltgit/quark-core-builder:latest
55+
56+
- name: Print ccache stats
57+
run: |
58+
docker run --rm \
59+
--entrypoint ccache \
60+
-v $HOME/.ccache-retroarch:/ccache \
61+
-e CCACHE_DIR=/ccache \
62+
ghcr.io/cobaltgit/quark-core-builder:latest \
63+
--show-stats
64+
65+
- name: Upload cores artifact
66+
uses: actions/upload-artifact@v6
67+
with:
68+
name: retroarch-cores-${{ github.sha }}
69+
path: output/
70+
retention-days: 3

.github/workflows/nightly.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Nightly
2+
3+
on:
4+
push:
5+
branches:
6+
- devel
7+
8+
jobs:
9+
build-cores:
10+
uses: ./.github/workflows/build-cores.yml
11+
12+
nightly:
13+
runs-on: ubuntu-latest
14+
needs: build-cores
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v6
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Set up Nim
24+
uses: jiro4989/setup-nim-action@v2
25+
with:
26+
nim-version: "2.2.8"
27+
28+
- name: Cache Nim packages
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.nimble
33+
~/.cache/nim
34+
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
35+
restore-keys: |
36+
${{ runner.os }}-nimble-
37+
38+
- name: Install Zig
39+
uses: goto-bus-stop/setup-zig@v2
40+
with:
41+
version: 0.15.2
42+
43+
- name: Cache Zig
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
~/.cache/zig
48+
${{ github.workspace }}/zig-cache
49+
key: ${{ runner.os }}-zig-0.15.2-${{ hashFiles('**/*.zig', 'build.zig', 'build.zig.zon') }}
50+
restore-keys: |
51+
${{ runner.os }}-zig-0.15.2-
52+
53+
- name: Install Rust
54+
uses: dtolnay/rust-toolchain@stable
55+
with:
56+
targets: armv7-unknown-linux-musleabihf
57+
58+
- name: Cache Cargo
59+
uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cargo/bin/
63+
~/.cargo/registry/index/
64+
~/.cargo/registry/cache/
65+
~/.cargo/git/db/
66+
target/
67+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
68+
restore-keys: |
69+
${{ runner.os }}-cargo-
70+
71+
- name: Install dependencies
72+
run: |
73+
sudo apt-get update
74+
sudo apt-get install cmake binutils-arm-linux-gnueabihf openssh-client -y
75+
76+
- name: Install cargo-zigbuild
77+
run: |
78+
if ! command -v cargo-zigbuild &> /dev/null; then
79+
cargo install cargo-zigbuild
80+
fi
81+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
82+
83+
- name: Install Nim zigcc wrapper
84+
run: |
85+
if ! nimble path zigcc &> /dev/null 2>&1; then
86+
nimble install zigcc -y
87+
fi
88+
89+
- name: Get commit info
90+
id: hash
91+
run: |
92+
HASH=$(git rev-parse --short=8 HEAD)
93+
COMMIT_MSG=$(git log -1 --pretty=%B | head -n 1)
94+
echo "hash=$HASH" >> $GITHUB_OUTPUT
95+
echo "commit_msg=$COMMIT_MSG" >> $GITHUB_OUTPUT
96+
echo "Commit: $HASH - $COMMIT_MSG"
97+
98+
- name: Download RetroArch cores
99+
uses: actions/download-artifact@v4
100+
with:
101+
name: ${{ needs.build-cores.outputs.artifact-name }}
102+
path: retroarch-cores
103+
104+
- name: Build nightly
105+
run: NIGHTLY=1 nimble updater -y --verbose
106+
107+
- name: Delete old continuous release
108+
run: "gh release delete nightly -y --cleanup-tag || true"
109+
env:
110+
GH_TOKEN: ${{ github.token }}
111+
112+
- name: Create continuous release
113+
id: create_release
114+
uses: actions/create-release@v1
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
with:
118+
tag_name: nightly
119+
release_name: "Continuous build"
120+
body: |
121+
Automated build of the latest commit. Do note that these builds are not stable.
122+
For stable releases, see the [releases page](https://github.com/${{ github.repository }}/releases).
123+
124+
**Commit:** `${{ steps.hash.outputs.hash }}`
125+
**Message:** ${{ steps.hash.outputs.commit_msg }}
126+
**Built:** ${{ github.event.head_commit.timestamp }}
127+
128+
draft: false
129+
prerelease: true
130+
131+
- name: Upload BASE zip
132+
uses: actions/upload-release-asset@v1
133+
env:
134+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135+
with:
136+
upload_url: ${{ steps.create_release.outputs.upload_url }}
137+
asset_path: ./Quark-${{ steps.hash.outputs.hash }}-BASE.zip
138+
asset_name: Quark-${{ steps.hash.outputs.hash }}-BASE.zip
139+
asset_content_type: application/zip
140+
141+
- name: Upload Updater zip
142+
uses: actions/upload-release-asset@v1
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
with:
146+
upload_url: ${{ steps.create_release.outputs.upload_url }}
147+
asset_path: ./Quark-${{ steps.hash.outputs.hash }}-Updater.zip
148+
asset_name: Quark-${{ steps.hash.outputs.hash }}-Updater.zip
149+
asset_content_type: application/zip
150+
151+
- name: Upload via SFTP
152+
env:
153+
SFTP_KEY: ${{ secrets.SFTP_KEY }}
154+
run: |
155+
echo "$SFTP_KEY" > /tmp/sftp_key
156+
chmod 600 /tmp/sftp_key
157+
sftp -o StrictHostKeyChecking=accept-new -i /tmp/sftp_key debian@q.sartor.vip <<EOF
158+
put Quark-${{ steps.hash.outputs.hash }}-Updater.zip /var/www/qstore/store/packages/vip.sartor.q.nightly.zip
159+
bye
160+
EOF
161+
rm /tmp/sftp_key

.github/workflows/release.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-cores:
10+
uses: ./.github/workflows/build-cores.yml
11+
12+
release:
13+
runs-on: ubuntu-latest
14+
needs: build-cores
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- name: Extract version from tag
24+
id: version
25+
run: |
26+
VERSION="${GITHUB_REF_NAME#v}"
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
echo "Version: $VERSION"
29+
30+
- name: Set up Nim
31+
uses: jiro4989/setup-nim-action@v2
32+
with:
33+
nim-version: "2.2.8"
34+
35+
- name: Cache Nim packages
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.nimble
40+
~/.cache/nim
41+
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
42+
restore-keys: |
43+
${{ runner.os }}-nimble-
44+
45+
- name: Install Zig
46+
uses: goto-bus-stop/setup-zig@v2
47+
with:
48+
version: 0.15.2
49+
50+
- name: Cache Zig
51+
uses: actions/cache@v5
52+
with:
53+
path: |
54+
~/.cache/zig
55+
${{ github.workspace }}/zig-cache
56+
key: ${{ runner.os }}-zig-0.15.2-${{ hashFiles('**/*.zig', 'build.zig', 'build.zig.zon') }}
57+
restore-keys: |
58+
${{ runner.os }}-zig-0.15.2-
59+
60+
- name: Install Rust
61+
uses: dtolnay/rust-toolchain@stable
62+
with:
63+
targets: armv7-unknown-linux-musleabihf
64+
65+
- name: Cache Cargo
66+
uses: actions/cache@v5
67+
with:
68+
path: |
69+
~/.cargo/bin/
70+
~/.cargo/registry/index/
71+
~/.cargo/registry/cache/
72+
~/.cargo/git/db/
73+
target/
74+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
75+
restore-keys: |
76+
${{ runner.os }}-cargo-
77+
78+
- name: Install dependencies
79+
run: |
80+
sudo apt-get update
81+
sudo apt-get install cmake binutils-arm-linux-gnueabihf openssh-client -y
82+
83+
- name: Install cargo-zigbuild
84+
run: |
85+
if ! command -v cargo-zigbuild &> /dev/null; then
86+
cargo install cargo-zigbuild
87+
fi
88+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
89+
90+
- name: Install Nim zigcc wrapper
91+
run: |
92+
if ! nimble path zigcc &> /dev/null 2>&1; then
93+
nimble install zigcc -y
94+
fi
95+
96+
- name: Download RetroArch cores
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: ${{ needs.build-cores.outputs.artifact-name }}
100+
path: retroarch-cores
101+
102+
- name: Build project
103+
run: nimble full -y
104+
105+
- name: Generate release checksums
106+
run: |
107+
sha256sum Quark-v${{ steps.version.outputs.version }}-BASE.zip > Quark-v${{ steps.version.outputs.version }}-BASE.zip.sha256
108+
sha256sum Quark-v${{ steps.version.outputs.version }}-FULL.zip > Quark-v${{ steps.version.outputs.version }}-FULL.zip.sha256
109+
110+
- name: Create draft release and upload assets
111+
uses: softprops/action-gh-release@v2
112+
with:
113+
tag_name: ${{ github.ref_name }}
114+
name: Quark ${{ github.ref_name }}
115+
draft: true
116+
prerelease: false
117+
files: |
118+
Quark-v${{ steps.version.outputs.version }}-BASE.zip
119+
Quark-v${{ steps.version.outputs.version }}-BASE.zip.sha256
120+
Quark-v${{ steps.version.outputs.version }}-FULL.zip
121+
Quark-v${{ steps.version.outputs.version }}-FULL.zip.sha256
122+
Quark-v${{ steps.version.outputs.version }}-Updater.zip
123+
124+
- name: Upload via SFTP
125+
env:
126+
SFTP_KEY: ${{ secrets.SFTP_KEY }}
127+
run: |
128+
echo "$SFTP_KEY" > /tmp/sftp_key
129+
chmod 600 /tmp/sftp_key
130+
sftp -o StrictHostKeyChecking=accept-new -i /tmp/sftp_key debian@q.sartor.vip <<EOF
131+
put Quark-v${{ steps.version.outputs.version }}-Updater.zip /var/www/qstore/store/packages/vip.sartor.q.stable.zip
132+
bye
133+
EOF
134+
rm /tmp/sftp_key

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.DS_Store
22
._*
3+
build/
4+
dist/

.gitmodules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[submodule "third-party/dropbear"]
2+
path = modules/third-party/dropbear
3+
url = https://github.com/mkj/dropbear
4+
[submodule "third-party/jq"]
5+
path = modules/third-party/jq
6+
url = https://github.com/jqlang/jq
7+
[submodule "third-party/gesftpserver"]
8+
path = modules/third-party/gesftpserver
9+
url = https://github.com/ewxrjk/sftpserver
10+
[submodule "third-party/dufs"]
11+
path = modules/third-party/dufs
12+
url = https://github.com/sigoden/dufs
13+
[submodule "third-party/evtest"]
14+
path = modules/third-party/evtest
15+
url = https://github.com/freedesktop-unofficial-mirror/evtest
16+
[submodule "modules/gluons"]
17+
path = modules/gluons
18+
url = https://github.com/cobaltgit/Quark-Gluons

0 commit comments

Comments
 (0)