-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dump asm to a separate branch (#1000)
- Loading branch information
Showing
6 changed files
with
127 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
git clone /input /tmp/input | ||
cd /tmp/input | ||
ln -s /opt/mwcc_compiler tools/ | ||
|
||
. /opt/venv/bin/activate | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
make -j"$(nproc)" WINE="$WINE" GENERATE_MAP=1 MAX_ERRORS=1 | ||
cp build/ssbm.us.1.2/GALE01.map /output/ | ||
python tools/parse_map.py | ||
dadosod dol build/ssbm.us.1.2/main.dol \ | ||
-m build/map.csv \ | ||
-o /output |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
run-name: Dump assembly | ||
name: dump-asm | ||
|
||
on: | ||
push: | ||
paths: [ "**" ] | ||
pull_request: | ||
|
||
jobs: | ||
dump-asm: | ||
name: Dump assembly | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ghcr.io | ||
steps: | ||
- name: Get image name | ||
env: | ||
EVENT_NAME: ${{ github.event_name }} | ||
PUSH_REPO_NAME: ${{ github.repository }} | ||
PR_REPO_NAME: ${{ github.event.repository.full_name }} | ||
IMAGE_SUFFIX: dump-asm:latest | ||
shell: bash | ||
run: | | ||
result="" | ||
case "$EVENT_NAME" in | ||
push) | ||
result="$PUSH_REPO_NAME" | ||
;; | ||
pull_request) | ||
result="$PR_REPO_NAME" | ||
;; | ||
esac | ||
result=$(echo "$result/$IMAGE_SUFFIX" | tr '[:upper:]' '[:lower:]') | ||
echo "IMAGE=$result" >> $GITHUB_ENV | ||
- name: Checkout Melee repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log into container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Pull assembly dump image | ||
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE }} | ||
|
||
- name: Dump assembly | ||
run: | | ||
docker run --rm \ | ||
--volume "$PWD:/input:ro" \ | ||
--volume /tmp/output:/output \ | ||
${{ env.REGISTRY }}/${{ env.IMAGE }} | ||
- name: Upload dumped assembly | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dump | ||
path: /tmp/output | ||
|
||
push-dump: | ||
name: Push dump | ||
runs-on: ubuntu-latest | ||
needs: dump-asm | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | ||
concurrency: | ||
group: "dump" | ||
cancel-in-progress: true | ||
|
||
steps: | ||
- name: Download dumped assembly | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dump | ||
path: /tmp/output | ||
|
||
- name: Checkout Melee repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: dump | ||
|
||
- name: Push to dump branch | ||
run: | | ||
rsync -r --delete --exclude '.git' /tmp/output/ . | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit --allow-empty \ | ||
--author "${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>" \ | ||
-m "Dump of ${{ github.sha }}" | ||
git push |
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
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