From e3c2442eae9f8e0ea34f21b9d15cc04d90a2b6e6 Mon Sep 17 00:00:00 2001
From: jugeeya <jugeeya@live.com>
Date: Sun, 5 Jul 2020 15:29:49 -0700
Subject: [PATCH] use DKP Docker container

---
 .github/workflows/rust.yml | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index a70a9ab..f8659d2 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -5,24 +5,28 @@ on:
     branches: [ master ]
 
 jobs:
-  build:
-
+  overlay:
     runs-on: ubuntu-latest
+    container: devkitpro/devkita64:latest
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@master
     - name: Sync submodules
       run: git submodule sync --recursive && git submodule update --init --recursive
-    - name: Download DEVKITPRO
-      run: wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb
-    - name: Install gdebi-core
-      run: sudo apt-get install gdebi-core
-    - name: Install DEVKITPRO
-      run: DEBIAN_FRONTEND=noninteractive sudo apt install ./devkitpro-pacman.amd64.deb
-    - name: Install packages
-      run: printf "\nY" | sudo dkp-pacman -Sy switch-dev
-    - name: Make Tesla overlay
-      working-directory: TrainingModpackOverlay
-      run: DEVKITPRO=/opt/devkitpro make
+    - name: make
+      run: make
+    - name: Upload build artifact
+      uses: actions/upload-artifact@v1
+      with:
+        name: overlay
+        path: TrainingModpackOverlay/ovlTrainingModpack.ovl
+  upload:
+    runs-on: ubuntu-latest
+    needs: overlay
+    steps:
+    - uses: actions/download-artifact@v1
+      with:
+        name: overlay
+    - uses: actions/checkout@v2
     - name: Install cargo-skyline
       run: cargo install --git https://github.com/jam1garner/cargo-skyline
     - name: Install rust-std-skyline-squashed
@@ -36,7 +40,7 @@ jobs:
         mkdir -p atmosphere/contents/01006A800016E000/romfs/skyline/plugins/ 
         cp ./target/aarch64-skyline-switch/release/libtraining_modpack.nro atmosphere/contents/01006A800016E000/romfs/skyline/plugins/libtraining_modpack.nro
         mkdir -p switch/.overlays/
-        cp TrainingModpackOverlay/ovlTrainingModpack.ovl switch/.overlays/ovlTrainingModpack.ovl
+        cp overlay/TrainingModpackOverlay/ovlTrainingModpack.ovl switch/.overlays/ovlTrainingModpack.ovl
         zip -r training_modpack_beta.zip atmosphere switch 
     - name: Update Release
       uses: meeDamian/github-release@2.0