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

Use devkitPro #26

Merged
merged 6 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
84 changes: 52 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,63 @@ concurrency:
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
compile-binaries:
runs-on: ubuntu-latest
container:
image: xzonn/devkitarm:latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Merge messages
run: |
python scripts/merge_messages.py
env:
PYTHONUTF8: 1
- name: Diamond and Pearl
continue-on-error: true
run: |
dotnet-script scripts/DP.csx
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Platinum
continue-on-error: true
run: |
dotnet-script scripts/Pt.csx
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Heart Gold and Soul Silver
continue-on-error: true
run: |
dotnet-script scripts/HGSS.csx
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
if-no-files-found: error
retention-days: 1
path: |
out/

full-build:
needs: compile-binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
repository: Xzonn/PCTRTools
ref: master
fetch-depth: 1
path: tools
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/download-artifact@v4
with:
name: binaries
path: out
- name: Get tools commit id
id: get-tools-commit-id
run: |
Expand All @@ -40,7 +81,7 @@ jobs:
with:
path: tools/PCTRTools/bin/Release/
key: tools-${{ steps.get-tools-commit-id.outputs.id }}
- uses: microsoft/setup-msbuild@v1
- uses: microsoft/setup-msbuild@v2
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
- name: Build tools
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
Expand All @@ -53,11 +94,6 @@ jobs:
id: commit
run: |
echo "commit_message=$(git log -1 --pretty=%s)" >> $env:GITHUB_OUTPUT
echo "changed_dp=$(git diff --name-only HEAD..HEAD~1 | Select-String -Pattern '\.github[\\/]workflows[\\/]|scripts[\\/]|files[\\/](?:(?:DP|D|P|Common)[\\/]|CharTable\.txt)|textures[\\/](?:DP|D|P)[\\/]|scripts[\\/](?:DP|D|P)\.')" >> $env:GITHUB_OUTPUT
echo "changed_pt=$(git diff --name-only HEAD..HEAD~1 | Select-String -Pattern '\.github[\\/]workflows[\\/]|scripts[\\/]|files[\\/](?:(?:Pt|Common)[\\/]|CharTable\.txt)|textures[\\/](?:DP|Pt)[\\/]|scripts[\\/]Pt\.')" >> $env:GITHUB_OUTPUT
echo "changed_hgss=$(git diff --name-only HEAD..HEAD~1 | Select-String -Pattern '\.github[\\/]workflows[\\/]|scripts[\\/]|files[\\/](?:(?:HGSS|HG|SS|Common)[\\/]|CharTable\.txt)|textures[\\/](?:DP|HGSS)[\\/]|scripts[\\/](?:HGSS|HG|SS)\.')" >> $env:GITHUB_OUTPUT
echo "changed_bw=$(git diff --name-only HEAD..HEAD~1 | Select-String -Pattern '\.github[\\/]workflows[\\/]|scripts[\\/]|files[\\/](?:(?:BW|B|W|Common)[\\/]|CharTable\.txt)|textures[\\/](?:BW)[\\/]|scripts[\\/](?:BW|B|W)\.')" >> $env:GITHUB_OUTPUT
echo "changed_b2w2=$(git diff --name-only HEAD..HEAD~1 | Select-String -Pattern '\.github[\\/]workflows[\\/]|scripts[\\/]|files[\\/](?:(?:B2W2|B2|W2|Common)[\\/]|CharTable\.txt)|textures[\\/](?:B2W2)[\\/]|scripts[\\/](?:B2W2|B2|W2)\.')" >> $env:GITHUB_OUTPUT
- name: Configure dotnet script
run: |
Try
Expand All @@ -68,46 +104,30 @@ jobs:
{
dotnet tool install -g dotnet-script
}
- name: Merge messages
- name: Prepare messages and textures
run: |
python scripts/merge_messages.py
dotnet script scripts/copy_textures.csx
env:
PYTHONUTF8: 1
- name: Diamond and Pearl
if: steps.commit.outputs.changed_dp != ''
continue-on-error: true
run: |
scripts/DP.ps1
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Platinum
if: steps.commit.outputs.changed_pt != ''
continue-on-error: true
run: |
scripts/Pt.ps1
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Heart Gold and Soul Silver
if: steps.commit.outputs.changed_hgss != ''
continue-on-error: true
run: |
scripts/HGSS.ps1
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Black and White
if: steps.commit.outputs.changed_bw != ''
continue-on-error: true
run: |
scripts/BW.ps1
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Black 2 and White 2
if: steps.commit.outputs.changed_b2w2 != ''
continue-on-error: true
run: |
scripts/B2W2.ps1
env:
XZ_PATCH_VERSION: "${{ github.sha }}"
- name: Upload artifacts
if: ${{ !inputs.publish }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -137,4 +157,4 @@ jobs:
name: "${{ steps.commit.outputs.commit_message }}"
prerelease: true
tag: dev-pub
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/build_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build on push

on:
push:
branches:
branches:
- master
paths-ignore:
- '*.md'
Expand All @@ -21,4 +21,4 @@ jobs:
build:
uses: ./.github/workflows/build.yml
with:
publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
maintenance/
out/

*.bak
*.nds
*.zip

pyrightconfig.json

tools
weblate

messages.txt
messages_common.txt
messages_script.txt
*.jpn.txt

__pycache__/
__pycache__/
.vscode/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools"]
path = tools
url = https://github.com/Xzonn/PCTRTools.git
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: \.json
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --select, I]
- id: ruff-format
args: [--config, indent-width=2, --config, line-length=120]
exclude: ^(original_files|texts)/
Loading