Publish #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: buildjet-2vcpu-ubuntu-2204 | |
strategy: | |
matrix: | |
include: | |
# - name: "Raspberry Pi 32-bit" | |
# id: "32bit" | |
# - name: "Raspberry Pi 64-bit" | |
# id: "64bit" | |
- name: "Banana Pi M4 zero" | |
id: "bpim4" | |
steps: | |
- name: download armbian image | |
uses: robinraju/release-downloader@v1 | |
with: | |
tag: 'armbian-bpim4z-"24.11.0-trunk.303"' | |
fileName: '*' | |
out-file-path: images | |
- uses: actions/checkout@v4 | |
with: | |
path: publish/build | |
- name: Extract version from file | |
id: get_version | |
run: | | |
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: cd publish/build; ls -la .; pwd; make packer; make ${{ matrix.id }} | |
- 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 | |
sudo pishrink.sh -aZ "pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img" | |
# - name: Release | |
# uses: softprops/action-gh-release@v2 | |
# with: | |
# prerelease: false | |
# make_latest: true | |
# tag_name: v${{ env.VERSION }} | |
# name: Pwnagotchi v${{ env.VERSION }} | |
# files: pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz | |
# generate_release_notes: true | |
- name: Upload to gdrive | |
uses: agusprayogi02/[email protected] | |
with: | |
filename: pwnagotchi-${{ env.VERSION }}-${{ matrix.id }}.img.xz | |
folderId: ${{ secrets.GDRIVE_FOLDER_ID }} | |
credentials: ${{ secrets.GDRIVE_SERVICE_ACCOUNT }} | |
mimeType: application/x-xz |