Skip to content

Commit

Permalink
Use submodules instead of sources and patches.
Browse files Browse the repository at this point in the history
Signed-off-by: miigotu <[email protected]>

Break out common variable and method code into a separate script
  • Loading branch information
miigotu committed Jul 3, 2020
1 parent 275f440 commit a32a9d7
Show file tree
Hide file tree
Showing 28 changed files with 248 additions and 13,986 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.git/
#.git/
build/
31 changes: 20 additions & 11 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
Docker:
Expand All @@ -15,8 +12,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 1
persist-credentials: false
submodules: recursive
- name: Checkout submodules
uses: textbook/git-checkout-submodule-action@master
with:
remote: true
- name: Set up Docker Buildx
if: success()
id: buildx
Expand All @@ -28,9 +31,11 @@ jobs:
if: success()
id: prepare
run: |
echo ::set-output name=docker_platforms::linux/amd64,linux/386
echo ::set-output name=docker_username::miigotu
# echo ::set-output name=docker_platforms::linux/amd64,linux/386
echo ::set-output name=docker_platforms::linux/amd64
echo ::set-output name=github_image::docker.pkg.github.com/${GITHUB_REPOSITORY,,}/ps3dev
# echo ::set-output name=docker_image::docker.io/${GITHUB_REPOSITORY,,}
echo ::set-output name=docker_image::docker.io/ps3dev/ps3dev
VERSION_TAG=${GITHUB_REF#refs/*/}
echo ::set-output name=version::${VERSION_TAG%/merge}
- name: Available platforms
Expand All @@ -40,12 +45,16 @@ jobs:
if: success()
id: login
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
run: |
echo "${GITHUB_PASSWORD}" | docker login --username "${{ steps.prepare.outputs.docker_username }}" --password-stdin docker.pkg.github.com
echo ::set-output name=buildx::$(echo docker buildx build --output type=image,name=${{ steps.prepare.outputs.github_image }},push=true \
echo "${GITHUB_PASSWORD}" | docker login --username "${GITHUB_USERNAME}" --password-stdin docker.pkg.github.com
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin docker.io
echo ::set-output name=buildx::$(echo docker buildx build --output type=image,push=true \
--platform ${{ steps.prepare.outputs.docker_platforms }} --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache" \
--tag "${{ steps.prepare.outputs.github_image }}:${{ steps.prepare.outputs.version }}")
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}")
- name: Cache Docker layers
uses: actions/cache@v2
id: cache
Expand All @@ -55,11 +64,11 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Run Buildx (master)
if: success() && steps.prepare.outputs.version == 'master' && github.event_name != 'pull_request'
if: secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && success() && steps.prepare.outputs.version == 'master'
run: |
${{ steps.login.outputs.buildx }} --tag "${{ steps.prepare.outputs.github_image }}:latest" --file Dockerfile .
${{ steps.login.outputs.buildx }} --tag "${{ steps.prepare.outputs.docker }}:latest" --file Dockerfile .
- name: Run Buildx (non-master)
if: success() && steps.prepare.outputs.version != 'master' && github.event_name != 'pull_request'
if: secrets.DOCKER_USERNAME && secrets.DOCKER_PASSWORD && success() && steps.prepare.outputs.version != 'master'
run: |
${{ steps.login.outputs.buildx }} --file Dockerfile .
- name: Clear
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/update_submodules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Submodule Updater

on:
pull_request:
push:
branches:
- "submodules"

jobs:
Submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 1
persist-credentials: false
submodules: recursive
- name: Checkout submodules
uses: textbook/git-checkout-submodule-action@master
with:
remote: true
- uses: EndBug/add-and-commit@v4
with:
message: Update submodules
add: src
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
.idea/**
*.patch
*.diff
28 changes: 28 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[submodule "newlib"]
path = src/newlib-1.20.0
url = git://github.com/ps3dev/newlib-1.20.0-PS3.git
shallow = true
[submodule "binutils"]
path = src/binutils-2.22
url = git://github.com/ps3dev/binutils-2.22-PS3.git
shallow = true
[submodule "PSL1GHT"]
path = src/PSL1GHT
url = git://github.com/ps3dev/PSL1GHT.git
shallow = true
[submodule "ps3libraries"]
path = src/ps3libraries
url = git://github.com/ps3dev/ps3libraries.git
shallow = true
[submodule "config"]
path = src/config
url = git://git.savannah.gnu.org/config.git
shallow = true
[submodule "gdb"]
path = src/gdb-7.5.1
url = git://github.com/miigotu/gdb-7.5.1-PS3.git
shallow = true
[submodule "gcc"]
path = src/gcc-PS3
url = git://github.com/ps3dev/gcc-PS3.git
shallow = true
35 changes: 16 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
FROM ubuntu:xenial
FROM ubuntu:latest
LABEL maintainer="[email protected]"

ENV PS3DEV /usr/local/ps3dev
ENV PSL1GHT ${PS3DEV}
ENV PATH ${PATH}:${PS3DEV}/bin:${PS3DEV}/ppu/bin:${PS3DEV}/spu/bin

ENV PSL1GHT /usr/local/ps3dev
ENV PATH $PATH:/usr/local/ps3dev/bin:/usr/local/ps3dev/ppu/bin:/usr/local/ps3dev/spu/bin
ENV PS3TOOLCHAIN /ps3_toolchain
ENV DEBIAN_FRONTEND=noninteractive

RUN \
apt-get -y update && \
apt-get -y install \
autoconf bison build-essential ca-certificates flex git libelf-dev\
libgmp-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev \
texinfo wget zlib1g-dev && \
apt-get -y clean autoclean autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN mkdir /build
WORKDIR /build
COPY . /build
RUN apt-get -yq update && \
apt-get -y install autoconf bison build-essential flex git libelf-dev \
libgmp3-dev libncurses5-dev libssl-dev libtool-bin pkg-config python-dev texinfo wget zlib1g-dev && \
apt-get -y clean autoclean autoremove && \
find /var/cache/apt/archives /var/lib/apt/lists /var/lib/dpkg /var/log -not -name lock -type f -delete

# Fixes certificate errors with letsencrypt in ARMv7
RUN echo "\nca_certificate=/etc/ssl/certs/ca-certificates.crt" | tee -a /etc/wgetrc
RUN /build/toolchain.sh
RUN mkdir $PS3TOOLCHAIN $PS3DEV
WORKDIR $PS3TOOLCHAIN
COPY . .
VOLUME $PS3DEV
RUN $PS3TOOLCHAIN/toolchain.sh
RUN rm -rf $PS3TOOLCHAIN
CMD /bin/bash

3 changes: 2 additions & 1 deletion depends/check-gmp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
# check-gmp.sh by Timothy Redaelli ([email protected])
set -x

[ -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; }
([ -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; }
15 changes: 0 additions & 15 deletions patches/binutils-2.22-PS3.patch

This file was deleted.

Loading

0 comments on commit a32a9d7

Please sign in to comment.