Publish #26
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: | |
inputs: | |
version: | |
description: 'Version number' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract version from file | |
id: get_version | |
run: | | |
VERSION=$(cut -d "'" -f2 < pwnagotchi/_version.py) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: Set LAST_VERSION as an environment variable | |
run: echo "LAST_VERSION=${{ steps.get-latest-tag.outputs.tag }}" >> $GITHUB_ENV | |
- name: Install qemu dependencies | |
run: sudo apt update && sudo apt install qemu-user-static qemu-utils xz-utils -y | |
- name: Build img file | |
run: ls -la .; pwd; make all | |
- name: Transfer 64bit.img to docker and give permissions | |
run: sudo chown runner:docker "bananagotchi-64bit.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/pishrink | |
find /home/runner/work/ -type f -name "*.img" -exec sudo pishrink -aZ {} \; | |
- name: Change name of 64.img.xz to add version | |
run: | | |
mv "bananagotchi-64bit.img.xz" "bananagotchi-$VERSION-64bit.img.xz" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ env.VERSION }} | |
name: Bananagotchi v${{ env.VERSION }} | |
files: | | |
bananagotchi-${{ env.VERSION }}-64bit.img.xz | |
body: ${{ env.RELEASE_BODY }} | |
prerelease: true | |
generate_release_notes: true |