Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Update ctrtool.yml

Update ctrtool.yml #45

Workflow file for this run

name: Build ctrtool
on:
workflow_dispatch:
push:
branches:
- main
paths:
- ".github/workflows/*.yml"
jobs:
build-linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: "3DSGuy/Project_CTR"
- run: make deps
working-directory: ctrtool
- run: make
working-directory: ctrtool
- run: cp ctrtool/bin/ctrtool ctrtool-linux_amd64
- uses: actions/upload-artifact@v4
with:
name: ctrtool-linux_amd64
path: ctrtool-linux_amd64
build-linux-arm:
runs-on: ubuntu-latest
steps:
- uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ubuntu_latest
githubToken: ${{ github.token }}
shell: /bin/sh
dockerRunArgs: |
-v "${PWD}/artifacts:/artifacts"
install: |
apt update -y
apt install -y build-essential git
run: |
mkdir -p /build
git clone https://github.com/3DSGuy/Project_CTR.git /build
cd /build/ctrtool
make deps
make
cp bin/ctrtool /artifacts/ctrtool-linux_${{ matrix.arch }}
setup: |
mkdir -p "${PWD}/artifacts"
- uses: actions/upload-artifact@v4
with:
name: artifacts/ctrtool-linux_${{ matrix.arch }}
path: artifacts/ctrtool-linux_${{ matrix.arch }}
strategy:
matrix:
arch:
- aarch64
- armv7
build-macos:
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
repository: "3DSGuy/Project_CTR"
- run: make deps
working-directory: ctrtool
- run: make
working-directory: ctrtool
- run: cp ctrtool/bin/ctrtool ctrtool-macos-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
name: ctrtool-macos-${{ matrix.arch }}
path: ctrtool-macos-${{ matrix.arch }}
strategy:
matrix:
include:
- arch: arm64
runs-on: flyci-macos-large-latest-m2
- arch: x86_64
runs-on: macos-latest
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
repository: "3DSGuy/Project_CTR"
- uses: microsoft/setup-msbuild@v2
- run: msbuild ctrtool/build/visualstudio/CTRTool.sln /p:configuration=Release /p:platform=${{ matrix.platform }}
- run: cp ctrtool/build/visualstudio/${{ matrix.platform == 'x64' && 'x64/' || '' }}Release/CTRTool.exe ctrtool-win_${{ matrix.platform }}.exe
- uses: actions/upload-artifact@v4
with:
name: ctrtool-win_${{ matrix.platform }}.exe
path: ctrtool-win_${{ matrix.platform }}.exe
strategy:
matrix:
platform:
- x64
- x86
push:
needs:
- build-linux-amd64
- build-linux-arm
- build-macos
- build-windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ctrtool
- run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add --all .
git commit -m "Built ctrtool"
- uses: ad-m/[email protected]
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}