Skip to content

Commit

Permalink
[CI] Clone the Repository Manually using git clone, Fixes Getting Las…
Browse files Browse the repository at this point in the history
…t Changed X Package Commit
  • Loading branch information
KreitinnSoftware committed Nov 15, 2024
1 parent ffe6411 commit 836ded5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: "Clone Repository"
run: |
git clone https://github.com/KreitinnSoftware/MiceWine-RootFS-Generator
- name: "Environment Preparation"
run: |
sudo apt update
Expand All @@ -29,45 +32,52 @@ jobs:
- name: "Download Latest Release Rat Packages"
run: |
cd MiceWine-RootFS-Generator
curl -LO# $(curl -s https://api.github.com/repos/KreitinnSoftware/MiceWine-RootFS-Generator/releases/latest | grep "MiceWine-Packages.zip" | grep "browser_download_url" | sed "s/\"browser_download_url\"://g" | sed "s/\"//g")
unzip -o MiceWine-Packages.zip -d built-pkgs
- name: "Start Building (x86_64)"
run: |
cd MiceWine-RootFS-Generator
./build-all.sh x86_64
cd logs
7z a /home/runner/MiceWine-RootFS-x86_64-Logs.zip
cd ..
- name: "Create RootFS File (x86_64)"
run: |
cd MiceWine-RootFS-Generator
./create-rootfs.sh x86_64
mv "MiceWine-RootFS-($(git rev-parse --short HEAD))-x86_64.rat" /home/runner/MiceWine-RootFS-x86_64.rat
- name: "Clean (x86_64) RootFS"
run: |
cd MiceWine-RootFS-Generator
sudo rm -rf /data/data/com.micewine.emu/files/usr workdir rootfs
- name: "Start Building (aarch64)"
run: |
cd MiceWine-RootFS-Generator
./build-all.sh aarch64
cd logs
7z a /home/runner/MiceWine-RootFS-aarch64-Logs.zip
cd ..
- name: "Save All Rat Packages (for next build be faster)"
run: |
cd MiceWine-RootFS-Generator
cd built-pkgs
7z a /home/runner/MiceWine-Packages.zip
cd ..
- name: "Create RootFS File (aarch64)"
run: |
cd MiceWine-RootFS-Generator
./create-rootfs.sh aarch64
mv "MiceWine-RootFS-($(git rev-parse --short HEAD))-aarch64.rat" /home/runner/MiceWine-RootFS-aarch64.rat
- name: "Get Short SHA"
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
run: |
cd MiceWine-RootFS-Generator
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: "Create Release"
uses: softprops/action-gh-release@v2
Expand Down
4 changes: 2 additions & 2 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ setupPackage()
echo 'echo $? > exit_code' >> build.sh
echo "$PKG_VER" >> pkg-ver
echo "$CATEGORY" >> category
git -C "$INIT_DIR" log -1 --format="%H" -- "packages/$package/" > pkg-commit
git -C "$INIT_DIR" log -1 --format="%H" -- "packages/$package" > pkg-commit

chmod +x build.sh

Expand All @@ -318,7 +318,7 @@ setupPackages()

if [ -f "$packageFullPath" ]; then
packageCommit=$(cat "$packageCommitFullPath")
actualCommit=$(git -C "$INIT_DIR" log -1 --format="%H" "packages/$package")
actualCommit=$(git -C "$INIT_DIR" log -1 --format="%H" -- "packages/$package")

if [ "$packageCommit" == "$actualCommit" ]; then
installBuiltPackage "$packageFullPath"
Expand Down

0 comments on commit 836ded5

Please sign in to comment.