diff --git a/.github/workflows/ark.yml b/.github/workflows/ark.yml index be5b74fe..b97ea56d 100644 --- a/.github/workflows/ark.yml +++ b/.github/workflows/ark.yml @@ -11,8 +11,6 @@ on: - '*.pptx' - 'CHANGELOG.md' branches: [ main ] - pull_request: - branches: [ main ] jobs: check_date: runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..e6aa60c9 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,67 @@ +name: ARK-4 +on: + push: + paths-ignore: + - 'README.md' + - 'build.sh' + - '.github/ISSUES_TEMPLATE/*' + - '.github/screenshots/*' + - '.github/wallpapers/*' + - 'contrib/PC/ARKUpgrader' + - '*.pptx' + - 'CHANGELOG.md' + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + check_date: + runs-on: ubuntu-latest + name: Check latest commit + outputs: + should_run: ${{ steps.should_run.outputs.should_run }} + steps: + - uses: actions/checkout@v4 + - name: print latest_commit + run: echo ${{ github.sha }} + + - id: should_run + continue-on-error: true + name: check latest commit is less than a day + if: ${{ github.event_name == 'schedule' }} + run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "{name}={should_run::false}" >> $GITHUB_OUTPUT + + + + build: + needs: check_date + if: ${{ needs.check_date.outputs.should_run != 'false' }} + runs-on: ubuntu-latest + steps: + - name: Create Version + id: get_version + run: | + echo "VERSION=v$(date +%s)" >> $GITHUB_OUTPUT + + - uses: actions/checkout@v4 + - name: Install Dependencies + run: sudo apt-get install autoconf automake bison flex gcc libmpfr-dev libncurses5-dev libreadline-dev libusb-dev make patch subversion texinfo wget git python3 python3-pip python3-pycryptodome mkisofs && sudo pip3 install ecdsa pycryptodome + - name: Extract SDK + run: sudo 7z -o/usr/local/ x ./contrib/PC/PSPSDK/pspdev.7z + - name: Change Permissions + run: sudo chown $GITHUB_USER:$GITHUB_USER /usr/local/pspdev && sudo chmod 755 -R /usr/local/pspdev + - name: Setup Path + run: echo "/usr/local/pspdev/bin" >> $GITHUB_PATH + - name: Print PATH + run: echo $GITHUB_PATH + - name: Fix libmpfr + run: sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4 + - name: sign_np + run: cd .. && curl -OJL "https://github.com/swarzesherz/sign_np/archive/refs/tags/v1.0.2.tar.gz" && tar xvf sign_np-1.0.2.tar.gz && cd sign_np-1.0.2 && make && sudo cp sign_np /usr/local/pspdev/bin + - name: mkpsxiso + run: cd .. && curl -OJL "https://github.com/Lameguy64/mkpsxiso/releases/download/v2.03/mkpsxiso-2.03-Linux.deb" && sudo apt install ./mkpsxiso-2.03-Linux.deb + - name: Making ARK-4 + run: make + - name: Making DEBUG Version + run: | + make clean + make DEBUG=1