Compensate for ../../../<output file>.img

i assume this is for local builds, because it outputs the file outside of runner workdir entirely. compensated by making extra directory levels

Signed-off-by: EatPrilosec <ae3nerdgod@gmail.com>
This commit is contained in:
EatPrilosec
2024-08-25 05:29:56 -04:00
committed by GitHub
parent d6bd65333e
commit 6b6f5923ee

View File

@ -21,31 +21,32 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
path: publish/build
- name: Extract version from file
id: get_version
run: |
VERSION=$(cut -d "'" -f2 < pwnagotchi/_version.py)
VERSION=$(cut -d "'" -f2 < publish/build/pwnagotchi/_version.py)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install qemu dependencies
run: sudo apt update && sudo apt install qemu-user-static qemu-utils xz-utils -y
- name: Build ${{ matrix.name }} img file
run: ls -la .; pwd; make packer; make ${{ matrix.id }}
run: cd publish/build; ls -la .; pwd; make packer; make ${{ matrix.id }}
- name: Transfer ${{ matrix.name }} .img to docker and give permissions
run: sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img"
- name: Change name of .img.xz to add version
run: |
sudo chown runner:docker "pwnagotchi-${{ matrix.id }}.img"
mv "pwnagotchi-${{ matrix.id }}.img" "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img"
- name: PiShrink
run: |
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
find /home/runner/work/ -type f -name "pwnagotchi-${{ matrix.id }}.img" -exec sudo pishrink.sh -aZ {} \;
- name: Change name of .img.xz to add version
run: mv "pwnagotchi-${{ matrix.id }}.img.xz" "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz"
sudo pishrink.sh -aZ "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img"
- name: Release
uses: softprops/action-gh-release@v2