Merge pull request #7 from ps2homebrew/dependabot/github_actions/dot-… #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-compile | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
name: PS2Ident compilation | |
runs-on: ubuntu-latest | |
container: ps2dev/ps2dev:v1.0 | |
# instead of "ps2dev/ps2dev:latest" you can use different tags, for example for old projects you can use "ps2dev/ps2dev:v1.0" | |
steps: | |
- name: Install dependencies | |
run: | | |
apk add build-base git zip | |
- uses: actions/checkout@v3 | |
- name: Compile project | |
run: | | |
make | |
# commands for compiling your project | |
- name: Get short SHA and repository name | |
id: slug | |
run: | | |
echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" | |
echo "::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" | |
- name: Upload artifacts | |
if: ${{ success() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }} | |
path: | | |
PS2Ident.elf | |
PS2Ident.db | |
README.md | |
changelog.txt | |
LICENSE_OFL.txt | |
*.ttf | |
- name: Compile PCSX2 version | |
continue-on-error: true | |
run: | | |
make clean | |
make DEBUG=1 DSNET_HOST_SUPPORT=1 DISABLE_ILINK_DUMPING=1 | |
- name: Upload PCSX2 artifacts | |
if: ${{ success() }} | |
continue-on-error: true | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PCSX2 | |
path: | | |
PS2Ident.elf | |
PS2Ident.db | |
README.md | |
changelog.txt | |
LICENSE_OFL.txt | |
*.ttf | |
- name: Compile PS2TOOL version | |
continue-on-error: true | |
run: | | |
make clean | |
make DEBUG=1 DSNET_HOST_SUPPORT=1 | |
- name: Upload PS2TOOL artifacts | |
if: ${{ success() }} | |
continue-on-error: true | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL | |
path: | | |
PS2Ident_np.elf | |
PS2Ident.db | |
README.md | |
changelog.txt | |
LICENSE_OFL.txt | |
*.ttf | |
# 'path' will create artifact with all *.elf in working directory | |
# you can change this | |
build-ps2idbms: | |
name: PS2IDdbms compilation | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup msbuild | |
uses: microsoft/[email protected] | |
- name: Build | |
run: | | |
cd PS2IDBMS | |
msbuild /p:Configuration=Release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: PS2IDBMS | |
path: PS2IDBMS/Release/PS2IDBMS.exe | |
build-romimg: | |
name: ROMIMG compilation | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup msbuild | |
uses: microsoft/[email protected] | |
- name: Build | |
run: | | |
cd ROMIMG | |
msbuild /p:PlatformToolset=v142 /p:Configuration=Release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ROMIMG | |
path: ROMIMG/Release/ROMIMG.exe | |
release: | |
needs: [build, build-ps2idbms,build-romimg] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get short SHA and repository name | |
id: slug | |
run: | | |
echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" | |
echo "::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" | |
- name: Download PS2Ident artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }} | |
path: PS2Ident | |
- name: Prepare PS2Ident archive | |
run: | | |
7z a ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z PS2Ident/* | |
- name: Download PS2Ident for PS2TOOL artifact | |
uses: actions/[email protected] | |
with: | |
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL | |
path: PS2Ident-PS2TOOL | |
- name: Prepare PS2Ident for PS2TOOL archive | |
run: | | |
7z a ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z PS2Ident-PS2TOOL/* | |
- name: Download ps2idbms artifact | |
uses: actions/[email protected] | |
with: | |
name: PS2IDBMS | |
- name: Download romimg artifact | |
uses: actions/[email protected] | |
with: | |
name: ROMIMG | |
- name: Create pre-release | |
if: github.ref == 'refs/heads/master' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: true | |
automatic_release_tag: "latest" | |
title: "Development build" | |
files: | | |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z | |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z | |
PS2IDBMS.exe | |
ROMIMG.exe | |
- name: Create Tagged Release Draft | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
automatic_release_tag: "stable" | |
draft: true | |
files: | | |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z | |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z | |
PS2IDBMS.exe | |