Skip to content

Commit a32a9d7

Browse files
committed
Use submodules instead of sources and patches.
Signed-off-by: miigotu <[email protected]> Break out common variable and method code into a separate script
1 parent 275f440 commit a32a9d7

28 files changed

+248
-13986
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.git/
1+
#.git/
22
build/

.github/workflows/deploy.yaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- '*'
7-
pull_request:
8-
branches:
9-
- '*'
107

118
jobs:
129
Docker:
@@ -15,8 +12,14 @@ jobs:
1512
- name: Checkout
1613
uses: actions/checkout@v2
1714
with:
15+
ref: ${{ github.head_ref }}
1816
fetch-depth: 1
1917
persist-credentials: false
18+
submodules: recursive
19+
- name: Checkout submodules
20+
uses: textbook/git-checkout-submodule-action@master
21+
with:
22+
remote: true
2023
- name: Set up Docker Buildx
2124
if: success()
2225
id: buildx
@@ -28,9 +31,11 @@ jobs:
2831
if: success()
2932
id: prepare
3033
run: |
31-
echo ::set-output name=docker_platforms::linux/amd64,linux/386
32-
echo ::set-output name=docker_username::miigotu
34+
# echo ::set-output name=docker_platforms::linux/amd64,linux/386
35+
echo ::set-output name=docker_platforms::linux/amd64
3336
echo ::set-output name=github_image::docker.pkg.github.com/${GITHUB_REPOSITORY,,}/ps3dev
37+
# echo ::set-output name=docker_image::docker.io/${GITHUB_REPOSITORY,,}
38+
echo ::set-output name=docker_image::docker.io/ps3dev/ps3dev
3439
VERSION_TAG=${GITHUB_REF#refs/*/}
3540
echo ::set-output name=version::${VERSION_TAG%/merge}
3641
- name: Available platforms
@@ -40,12 +45,16 @@ jobs:
4045
if: success()
4146
id: login
4247
env:
48+
GITHUB_USERNAME: ${{ github.actor }}
4349
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
50+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
51+
DOCKER_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
4452
run: |
45-
echo "${GITHUB_PASSWORD}" | docker login --username "${{ steps.prepare.outputs.docker_username }}" --password-stdin docker.pkg.github.com
46-
echo ::set-output name=buildx::$(echo docker buildx build --output type=image,name=${{ steps.prepare.outputs.github_image }},push=true \
53+
echo "${GITHUB_PASSWORD}" | docker login --username "${GITHUB_USERNAME}" --password-stdin docker.pkg.github.com
54+
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin docker.io
55+
echo ::set-output name=buildx::$(echo docker buildx build --output type=image,push=true \
4756
--platform ${{ steps.prepare.outputs.docker_platforms }} --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache" \
48-
--tag "${{ steps.prepare.outputs.github_image }}:${{ steps.prepare.outputs.version }}")
57+
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}")
4958
- name: Cache Docker layers
5059
uses: actions/cache@v2
5160
id: cache
@@ -55,11 +64,11 @@ jobs:
5564
restore-keys: |
5665
${{ runner.os }}-buildx-
5766
- name: Run Buildx (master)
58-
if: success() && steps.prepare.outputs.version == 'master' && github.event_name != 'pull_request'
67+
if: secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && success() && steps.prepare.outputs.version == 'master'
5968
run: |
60-
${{ steps.login.outputs.buildx }} --tag "${{ steps.prepare.outputs.github_image }}:latest" --file Dockerfile .
69+
${{ steps.login.outputs.buildx }} --tag "${{ steps.prepare.outputs.docker }}:latest" --file Dockerfile .
6170
- name: Run Buildx (non-master)
62-
if: success() && steps.prepare.outputs.version != 'master' && github.event_name != 'pull_request'
71+
if: secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && success() && steps.prepare.outputs.version != 'master'
6372
run: |
6473
${{ steps.login.outputs.buildx }} --file Dockerfile .
6574
- name: Clear
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Submodule Updater
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "submodules"
8+
9+
jobs:
10+
Submodules:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
ref: ${{ github.head_ref }}
17+
fetch-depth: 1
18+
persist-credentials: false
19+
submodules: recursive
20+
- name: Checkout submodules
21+
uses: textbook/git-checkout-submodule-action@master
22+
with:
23+
remote: true
24+
- uses: EndBug/add-and-commit@v4
25+
with:
26+
message: Update submodules
27+
add: src
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

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

.gitmodules

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[submodule "newlib"]
2+
path = src/newlib-1.20.0
3+
url = git://github.com/ps3dev/newlib-1.20.0-PS3.git
4+
shallow = true
5+
[submodule "binutils"]
6+
path = src/binutils-2.22
7+
url = git://github.com/ps3dev/binutils-2.22-PS3.git
8+
shallow = true
9+
[submodule "PSL1GHT"]
10+
path = src/PSL1GHT
11+
url = git://github.com/ps3dev/PSL1GHT.git
12+
shallow = true
13+
[submodule "ps3libraries"]
14+
path = src/ps3libraries
15+
url = git://github.com/ps3dev/ps3libraries.git
16+
shallow = true
17+
[submodule "config"]
18+
path = src/config
19+
url = git://git.savannah.gnu.org/config.git
20+
shallow = true
21+
[submodule "gdb"]
22+
path = src/gdb-7.5.1
23+
url = git://github.com/miigotu/gdb-7.5.1-PS3.git
24+
shallow = true
25+
[submodule "gcc"]
26+
path = src/gcc-PS3
27+
url = git://github.com/ps3dev/gcc-PS3.git
28+
shallow = true

Dockerfile

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
FROM ubuntu:xenial
1+
FROM ubuntu:latest
22
LABEL maintainer="[email protected]"
33

44
ENV PS3DEV /usr/local/ps3dev
5-
ENV PSL1GHT ${PS3DEV}
6-
ENV PATH ${PATH}:${PS3DEV}/bin:${PS3DEV}/ppu/bin:${PS3DEV}/spu/bin
7-
5+
ENV PSL1GHT /usr/local/ps3dev
6+
ENV PATH $PATH:/usr/local/ps3dev/bin:/usr/local/ps3dev/ppu/bin:/usr/local/ps3dev/spu/bin
7+
ENV PS3TOOLCHAIN /ps3_toolchain
88
ENV DEBIAN_FRONTEND=noninteractive
99

10-
RUN \
11-
apt-get -y update && \
12-
apt-get -y install \
13-
autoconf bison build-essential ca-certificates flex git libelf-dev\
14-
libgmp-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev \
15-
texinfo wget zlib1g-dev && \
16-
apt-get -y clean autoclean autoremove && \
17-
rm -rf /var/lib/{apt,dpkg,cache,log}/
18-
19-
RUN mkdir /build
20-
WORKDIR /build
21-
COPY . /build
10+
RUN apt-get -yq update && \
11+
apt-get -y install autoconf bison build-essential flex git libelf-dev \
12+
libgmp3-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev texinfo wget zlib1g-dev && \
13+
apt-get -y clean autoclean autoremove && \
14+
find /var/cache/apt/archives /var/lib/apt/lists /var/lib/dpkg /var/log -not -name lock -type f -delete
2215

23-
# Fixes certificate errors with letsencrypt in ARMv7
24-
RUN echo "\nca_certificate=/etc/ssl/certs/ca-certificates.crt" | tee -a /etc/wgetrc
25-
RUN /build/toolchain.sh
16+
RUN mkdir $PS3TOOLCHAIN $PS3DEV
17+
WORKDIR $PS3TOOLCHAIN
18+
COPY . .
19+
VOLUME $PS3DEV
20+
RUN $PS3TOOLCHAIN/toolchain.sh
21+
RUN rm -rf $PS3TOOLCHAIN
22+
CMD /bin/bash
2623

depends/check-gmp.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
# check-gmp.sh by Timothy Redaelli ([email protected])
3+
set -x
34

4-
[ -f /usr/include/$(gcc -dumpmachine)/gmp.h -o -f /usr/include/gmp.h -o -f /opt/local/include/gmp.h -o -f /usr/local/include/gmp.h -o -f /opt/csw/include/gmp.h ] || { echo "ERROR: Install gmp before continuing."; exit 1; }
5+
([ -f /usr/include/$(gcc -dumpmachine)/gmp.h ] || [ -f /usr/include/gmp.h ] || [ -f /opt/local/include/gmp.h ] || [ -f /usr/local/include/gmp.h ] || [ -f /opt/csw/include/gmp.h ]) || { echo "ERROR: Install gmp before continuing."; exit 1; }

patches/binutils-2.22-PS3.patch

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

0 commit comments

Comments
 (0)