v1.1.39 #40
Workflow file for this run
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
on: | |
release: | |
types: [published] | |
name: Create RaspberryPi Release | |
jobs: | |
build: | |
name: Create Artifact | |
runs-on: ubuntu-latest | |
environment: | |
name: env | |
steps: | |
- name: Create stage | |
run: | | |
mkdir -p stage-custom/tweak | |
cat > stage-custom/tweak/00-run.sh <<'EOF' | |
#!/bin/bash | |
echo "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misogihagi" | |
echo $ROOTFS_DIR | |
echo $FIRST_USER_NAME | |
on_chroot << EOS | |
apt-get install -y curl git docker.io docker-compose code cmus | |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - | |
apt-get install -y nodejs | |
EOS | |
touch "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misogihagi" | |
touch "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misogihagi.pub" | |
chmod 600 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misogihagi" | |
touch "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misohagi-work" | |
touch "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misohagi-work.pub" | |
chmod 600 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.ssh/misohagi-work" | |
git config --global commit.gpgsign true | |
mkdir "${ROOTFS_DIR}/work" | |
mkdir "${ROOTFS_DIR}/work/misogihagi" | |
mkdir "${ROOTFS_DIR}/work/misohagi-work" | |
git config --global includeIf."gitdir:/work/".path "~/.gitconfig-misogihagi" | |
git config --global includeIf."gitdir:/work/".path "~/.gitconfig-misohagi-work" | |
EOF | |
chmod +x stage-custom/tweak/00-run.sh | |
cat stage-custom/tweak/00-run.sh | |
cat > stage-custom/prerun.sh <<-EOF | |
#!/bin/bash -e | |
if [ ! -d "\${ROOTFS_DIR}" ]; then | |
copy_previous | |
fi | |
EOF | |
chmod +x stage-custom/prerun.sh | |
- name: Run pigen | |
run: | | |
sudo apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \ | |
dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \ | |
gpg pigz xxd arch-test | |
git clone https://github.com/RPI-Distro/pi-gen.git | |
cd pi-gen | |
echo IMG_NAME=misogihagi-raspberrypi >> config | |
echo ARCHIVE_FILENAME=misogihagi-raspberrypi >> config | |
echo LOCALE_DEFAULT=en_US.UTF-8 >> config | |
echo TARGET_HOSTNAME=raspberrypi4 >> config | |
echo KEYBOARD_KEYMAP=us >> config | |
echo TIMEZONE_DEFAULT=America/Los_Angeles >> config | |
echo ENABLE_SSH=1 >> config | |
echo PUBKEY_ONLY_SSH=1 >> config | |
echo PUBKEY_SSH_FIRST_USER="\"${{ secrets.PUBKEY }}\"" >> config | |
echo WPA_COUNTRY=${{ secrets.WPA_COUNTRY }} >> config | |
echo WPA_PASSWORD=${{ secrets.WPA_PASSWORD }} >> config | |
cat config | |
rm -rf stage3 | |
mv ../stage-custom ./stage3 | |
rm -rf stage4 && mkdir stage4 && touch stage4/SKIP | |
rm -rf stage5 && mkdir stage5 && touch stage5/SKIP | |
./build-docker.sh -c config | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./pi-gen/deploy/misogihagi-raspberrypi-lite.zip | |
asset_name: misogihagi-raspberrypi.zip | |
asset_content_type: application/zip |