Skip to content

workflow: checkout with full history #145

workflow: checkout with full history

workflow: checkout with full history #145

Workflow file for this run

name: Build pkmn-chest
on:
push:
branches-ignore: [translation]
paths-ignore:
- 'README.md'
pull_request:
branches: ["*"]
paths-ignore:
- 'README.md'
release:
types: [created]
jobs:
build:
runs-on: macos-latest
name: Build pkmn-chest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install tools
run: |
curl -L https://github.com/Universal-Team/bmp2ds/releases/download/v1.0.0/bmp2ds-macos -o bmp2ds
chmod +x bmp2ds
mv bmp2ds /usr/local/bin
curl -LO https://github.com/devkitPro/pacman/releases/latest/download/devkitpro-pacman-installer.pkg
sudo installer -pkg devkitpro-pacman-installer.pkg -target /
sudo dkp-pacman -Sy
sudo dkp-pacman -S nds-dev --noconfirm
- name: Build
id: build
run: |
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=$DEVKITPRO/devkitARM
make all dsi
sudo mv tools-osx/make_cia /usr/local/bin
make cia
mkdir -p ~/artifacts
cp pkmn-chest.* ~/artifacts
- name: Publish build to GH Actions
uses: actions/upload-artifact@v4
with:
path: ~/artifacts/*
name: build
# Only run this for non-PR jobs.
publish_build:
runs-on: ubuntu-latest
name: Publish build to Universal-Team/extras
if: ${{ success() && !startsWith(github.ref, 'refs/pull') }}
needs: build
steps:
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install qrencode -y
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build
path: build
- name: Upload to ${{ github.repository }} release
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
ID=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)
for file in ${{ github.workspace }}/build/*; do
AUTH_HEADER="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
CONTENT_LENGTH="Content-Length: $(stat -c%s $file)"
CONTENT_TYPE="Content-Type: application/7z-x-compressed"
UPLOAD_URL="https://uploads.github.com/repos/${{ github.repository }}/releases/$ID/assets?name=$(basename $file)"
curl -XPOST -H "$AUTH_HEADER" -H "$CONTENT_LENGTH" -H "$CONTENT_TYPE" --upload-file "$file" "$UPLOAD_URL"
done