mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 17:09:09 +00:00
Create the CI/CD of PSPSDK:
- Generate PSPSDK docker layer - Generate and expose all the samples binaries (PBP files) - Generate doxygen documentation and upload it to github pages
This commit is contained in:
23
.github/workflows/compilation.yml
vendored
23
.github/workflows/compilation.yml
vendored
@@ -9,7 +9,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: pspdev/psptoolchain:latest
|
container: ghcr.io/fjtrujy/psptoolchain:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@@ -22,5 +22,24 @@ jobs:
|
|||||||
./bootstrap
|
./bootstrap
|
||||||
./configure
|
./configure
|
||||||
make clean
|
make clean
|
||||||
make -j2
|
make -j $(getconf _NPROCESSORS_ONLN)
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
- name: Get short SHA
|
||||||
|
id: slug
|
||||||
|
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||||
|
|
||||||
|
- name: Compile Examples
|
||||||
|
run: |
|
||||||
|
cd src/samples && make -f Makefile.samples
|
||||||
|
|
||||||
|
- name: Compress Samples folder folder
|
||||||
|
run: |
|
||||||
|
tar -zcvf samples.tar.gz src/samples
|
||||||
|
|
||||||
|
- name: Upload Samples artifacts
|
||||||
|
if: ${{ success() }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: samples-${{ steps.slug.outputs.sha8 }}
|
||||||
|
path: samples.tar.gz
|
||||||
|
61
.github/workflows/docker.yml
vendored
61
.github/workflows/docker.yml
vendored
@@ -4,21 +4,66 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
types: [run_build]
|
types: [run_build]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: docker/build-push-action@v1
|
- name: Extract DOCKER_TAG using tag name
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
run: |
|
||||||
|
echo "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Use default DOCKER_TAG
|
||||||
|
if: startsWith(github.ref, 'refs/tags/') != true
|
||||||
|
run: |
|
||||||
|
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to Github registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
repository: ${{ env.GITHUB_REPOSITORY }}
|
registry: ghcr.io
|
||||||
tags: latest
|
|
||||||
tag_with_ref: true
|
- uses: docker/build-push-action@v2
|
||||||
add_git_labels: true
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}
|
||||||
|
build-args: |
|
||||||
|
BASE_DOCKER_IMAGE=ghcr.io/${{ github.repository_owner }}/psptoolchain:${{ env.DOCKER_TAG }}
|
||||||
|
|
||||||
|
- name: Send Compile action
|
||||||
|
run: |
|
||||||
|
export DISPATCH_ACTION="$(echo run_build)"
|
||||||
|
echo "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Repository Dispatch to psp-packages
|
||||||
|
uses: peter-evans/repository-dispatch@v1
|
||||||
|
with:
|
||||||
|
repository: ${{ github.repository_owner }}/psp-packages
|
||||||
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||||
|
event-type: ${{ env.NEW_DISPATCH_ACTION }}
|
||||||
|
client-payload: '{"ref": "${{ github.ref }}"}'
|
||||||
|
|
||||||
|
- name: Repository Dispatch to psplinkusb
|
||||||
|
uses: peter-evans/repository-dispatch@v1
|
||||||
|
with:
|
||||||
|
repository: ${{ github.repository_owner }}/psplinkusb
|
||||||
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||||
|
event-type: ${{ env.NEW_DISPATCH_ACTION }}
|
||||||
|
client-payload: '{"ref": "${{ github.ref }}"}'
|
20
Dockerfile
20
Dockerfile
@@ -1,10 +1,26 @@
|
|||||||
# First stage
|
# First stage
|
||||||
FROM pspdev/psptoolchain:latest
|
ARG BASE_DOCKER_IMAGE
|
||||||
|
|
||||||
|
FROM $BASE_DOCKER_IMAGE
|
||||||
|
|
||||||
COPY . /src
|
COPY . /src
|
||||||
|
|
||||||
RUN apk add build-base autoconf automake zlib-dev
|
RUN apk add build-base autoconf automake zlib-dev
|
||||||
RUN cd /src && ./bootstrap && ./configure && make all install clean
|
RUN cd /src && \
|
||||||
|
./bootstrap && \
|
||||||
|
./configure && \
|
||||||
|
make -j $(getconf _NPROCESSORS_ONLN) clean && \
|
||||||
|
make -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
|
make -j $(getconf _NPROCESSORS_ONLN) install
|
||||||
|
|
||||||
|
## gcc needs to include libpsplibc libpsputility libpspnet_inet libpspnet_resolver libpspuser libpspkernel
|
||||||
|
## from pspsdk to be able to build executables, because they are part of the standard libraries
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpsplibc.a" "$PSPDEV/psp/lib/libpsplibc.a" || { exit 1; }
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpsputility.a" "$PSPDEV/psp/lib/libpsputility.a" || { exit 1; }
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpspnet_inet.a" "$PSPDEV/psp/lib/libpspnet_inet.a" || { exit 1; }
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpspnet_resolver.a" "$PSPDEV/psp/lib/libpspnet_resolver.a" || { exit 1; }
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpspuser.a" "$PSPDEV/psp/lib/libpspuser.a" || { exit 1; }
|
||||||
|
RUN ln -sf "$PSPDEV/psp/sdk/lib/libpspkernel.a" "$PSPDEV/psp/lib/libpspkernel.a" || { exit 1; }
|
||||||
|
|
||||||
# Second stage
|
# Second stage
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
Reference in New Issue
Block a user