Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action for CI/CD #6

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
67 changes: 67 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ci-docker
on:
pull_request:
branches:
- master

# Runs on pushes targeting the default branch
push:
branches: ['master']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
dockerhub-push:
runs-on: ubuntu-latest
environment: DockerHub
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
# - linux/arm/v7
# - linux/arm64/v8
# - linux/ppc64le
# - linux/s390x

env:
DOCKERHUB_REPONAME: ps3dev
DOCKERHUB_REPOTAG: latest

steps:

- name: Checkout
uses: actions/checkout@v4

- name: README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
with:
destination_container_repo: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPONAME }}
provider: dockerhub
short_description: 'A Docker Image for PS3 Development'
readme_file: 'README.md'

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPONAME }}:${{ env.DOCKERHUB_REPOTAG }}
61 changes: 45 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,50 @@
FROM debian:12-slim
MAINTAINER Naomi Peori <[email protected]>
FROM ubuntu:24.04

ENV PS3DEV /usr/local/ps3dev
ENV PSL1GHT ${PS3DEV}
ENV PATH ${PATH}:${PS3DEV}/bin:${PS3DEV}/ppu/bin:${PS3DEV}/spu/bin
ENV PS3DEV /usr/local/ps3dev
ENV PSL1GHT $PS3DEV
ENV PATH $PATH:$PS3DEV/bin:$PS3DEV/ppu/bin:$PS3DEV/spu/bin:$PS3DEV/portlibs/ppu/bin
ENV PKG_CONFIG_PATH $PKG_CONFIG_PATH:$PS3DEV/portlibs/ppu/lib/pkgconfig

RUN \
apt-get -y 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-is-python3 texinfo wget zlib1g-dev && \
apt-get -y clean autoclean autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
ENV DEBIAN_FRONTEND noninteractive

RUN \
git clone https://github.com/ps3dev/ps3toolchain.git && \
cd ps3toolchain && \
./toolchain.sh && \
cd .. && \
rm -Rf ps3toolchain
RUN apt update \
&& apt upgrade -y \
&& apt --no-install-recommends install -y \
autoconf \
automake \
bison \
bzip2 \
ca-certificates \
cmake \
flex \
gettext-base \
g++ \
gcc \
git \
libelf-dev \
libgmp3-dev \
libncurses5-dev \
libssl-dev \
libtool \
libtool-bin \
make \
meson \
patch \
pkg-config \
python-dev-is-python3 \
texinfo \
vim \
wget \
xz-utils \
zlib1g-dev \
# Fixes certificate errors with letsencrypt in ARMv7
&& echo "ca_certificate=/etc/ssl/certs/ca-certificates.crt" >> /etc/wgetrc \
&& echo "check_certificate = off" >> ~/.wgetrc \
# pass toolchain's check for gmp
&& ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
&& git clone https://github.com/humbertodias/ps3toolchain.git /toolchain \
&& /toolchain/toolchain.sh \
&& rm -rf /toolchain

WORKDIR /build
CMD ["/bin/bash"]
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[![ci-docker](https://github.com/humbertodias/ps3dev-docker/actions/workflows/deploy.yml/badge.svg)](https://github.com/humbertodias/ps3dev-docker/actions/workflows/deploy.yml)
[![](https://images.microbadger.com/badges/image/hldtux/ps3dev.svg)](https://microbadger.com/images/hldtux/ps3dev)
[![](https://img.shields.io/docker/pulls/hldtux/ps3dev.svg?maxAge=604800)](https://hub.docker.com/r/hldtux/ps3dev/)


## What does this do?

This program will automatically build a docker image with the ps3dev
toolchain ready to be used for homebrew development.

## How do I build it?

Build the image:

```sh
docker build -t ps3dev-docker .
```
Copy the helper script:

```
cp ps3dev-docker.sh /usr/local/bin
```
## How do I use it?

Use the helper script to run 'make' on the current directory:

```
ps3dev-docker.sh make
```
Or, manually run 'make' on the current directory:

```
docker run -v `pwd`:/build ps3dev-docker make
```

## How do I save and load it?

Save the image:

```
docker save ps3dev-docker | bzip2 > ps3dev-docker.tar.bz2
```
Load the image:

```
docker load < bzip2 -dc ps3dev-docker.tar.bz2
```
42 changes: 0 additions & 42 deletions readme.txt

This file was deleted.