forked from FIX94/Nintendont
-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (69 loc) · 2.52 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI Slippi Nintendont Builds
on:
workflow_dispatch:
inputs:
ignore:
description: 'ignore'
required: false
default: 'ignore'
push:
branches:
- slippi
- ci
pull_request:
paths-ignore:
- "**.md"
branches:
- "**"
jobs:
ubuntu64:
name: "Loader Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: recursive
- name: 'Fetch Git Tags'
shell: bash
if: success()
run: |
git fetch --prune --unshallow
echo "GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "CURR_DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
echo "CURR_TIMESTAMP=$(date +%Y%m%d000000)" >> $GITHUB_ENV
echo "NIN_VERSION=$(cat common/include/NintendontVersion.h | grep NIN_VERSION | cut -d " " -f 3 | cut -d "\"" -f 2)" >> $GITHUB_ENV
- name: "Build"
if: success()
working-directory: ${{ github.workspace }}
run: |
sudo docker run --volume=${PWD}:/work --workdir=/work nikhilnarayana/devkitpro-slippi:latest make -j7
- name: "Package"
if: success()
working-directory: ${{ github.workspace }}
run: |
mkdir artifact
cp ./loader/loader.* ./artifact/
mkdir -p "release-artifact/apps/Slippi Nintendont"
cp ./loader/loader.dol "./release-artifact/apps/Slippi Nintendont/boot.dol"
cp ./nintendont/{icon.png,meta.xml} "./release-artifact/apps/Slippi Nintendont/"
pushd "./release-artifact/apps/Slippi Nintendont/"
sed -i -e s/\<version\>/\<version\>${{ env.NIN_VERSION }}/ meta.xml
sed -i -e s/\<release_date\>/\<release_date\>${{ env.CURR_TIMESTAMP }}/ meta.xml
sed -i -e s/\<git_hash\>/\<git_hash\>${{ env.GIT_HASH }}/ meta.xml
popd
cp -r ./ci/* ./release-artifact/apps/
- name: "Publish Loader"
if: success()
uses: actions/upload-artifact@v3
with:
name: loader-${{ env.CURR_DATE }}-${{ env.GIT_HASH }}-${{ env.GIT_TAG }}
path: "./artifact/"
- name: "Publish Release Ready Loader"
if: success()
uses: actions/upload-artifact@v3
with:
name: release-${{ env.CURR_DATE }}-${{ env.GIT_HASH }}-${{ env.GIT_TAG }}
path: "./release-artifact/"