diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index b3da4d5..a886571 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -49,11 +49,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - *setup_pspdev + - name: Setup PSPDEV Environment + run: | + # Set OS specific variables + URL="https://github.com/pspdev/pspdev/releases/download/v20240609/pspdev-ubuntu-latest-x86_64.tar.gz" + FILE=$(basename $URL) + wget $URL + tar -xzf $FILE + echo "PSPDEV=$PWD/pspdev" >> $GITHUB_ENV + echo "$PWD/pspdev/bin" >> $GITHUB_PATH - name: Generate documentation run: make gendoc - - &publish_docs - name: Publish to GitHub Pages + - name: Publish to GitHub Pages run: make ghpages env: GIT_AUTHOR_NAME: github-actions @@ -67,7 +74,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - *setup_pspdev + - name: Setup PSPDEV Environment + run: | + # Set OS specific variables + URL="https://github.com/pspdev/pspdev/releases/download/v20240609/pspdev-ubuntu-latest-x86_64.tar.gz" + FILE=$(basename $URL) + wget $URL + tar -xzf $FILE + echo "PSPDEV=$PWD/pspdev" >> $GITHUB_ENV + echo "$PWD/pspdev/bin" >> $GITHUB_PATH - name: Build project run: make - name: Generate release files @@ -75,10 +90,17 @@ jobs: - name: Compress release run: | mkdir -p dist - tar -czf dist/oslib-release-${GITHUB_REF##*/}.tar.gz release/ + tar -czf dist/oslib-release-${GITHUB_REF##*/}.tar.gz Distrib/ - name: Generate documentation run: make gendoc - - *publish_docs + - name: Publish to GitHub Pages + run: make ghpages + env: + GIT_AUTHOR_NAME: github-actions + GIT_AUTHOR_EMAIL: github-actions@github.com + GIT_COMMITTER_NAME: github-actions + GIT_COMMITTER_EMAIL: github-actions@github.com + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish release on GitHub Releases uses: softprops/action-gh-release@v1 with: diff --git a/.gitignore b/.gitignore index a079701..c826aff 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ samples/**/*.SFO # Ignore documentation directory OSLib_Documentation/ src/libpspmath/*.a + +# Ignore release artifacts +Distrib/ +OSLib.zip diff --git a/Makefile b/Makefile index f38d007..cc84bf7 100644 --- a/Makefile +++ b/Makefile @@ -247,6 +247,9 @@ install: lib gendoc: doxygen +release: lib + ./release.sh + ghpages: gendoc rm -rf /tmp/ghpages mkdir -p /tmp/ghpages @@ -254,9 +257,11 @@ ghpages: gendoc cd /tmp/ghpages && \ git init && \ + git config user.name "$${GIT_AUTHOR_NAME:-github-actions}" && \ + git config user.email "$${GIT_AUTHOR_EMAIL:-github-actions@github.com}" && \ git add . && \ git commit -q -m "Automatic gh-pages" cd /tmp/ghpages && \ - git remote add remote git@github.com:dogo/oslib.git && \ + git remote add remote https://x-access-token:$${GITHUB_TOKEN}@github.com/dogo/oslib.git && \ git push --force remote +master:gh-pages rm -rf /tmp/ghpages diff --git a/release.sh b/release.sh old mode 100644 new mode 100755