Skip to content

Build PostmarketOS for QEMU #28

Build PostmarketOS for QEMU

Build PostmarketOS for QEMU #28

Workflow file for this run

name: "Build PostmarketOS for QEMU"
on:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
arch: ["amd64", "aarch64"]
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Get current date
id: date
run: echo "stamp=$(date '+%s')" >> $GITHUB_ENV
- name: Install tools
run: sudo apt update ; sudo apt -y install python-is-python3 python3-pip
- name: Install pmbootstrap
run: sudo apt update ; sudo pip3 install pmbootstrap
- name: Create work directory
run: mkdir -p /home/runner/.local/var/pmbootstrap
- name: Update pmbootstrap
run: pmbootstrap -c configs/pmbootstrap.${{ matrix.arch }}.cfg -y -p pmbootstrap/cache_git/pmaports/ pull
- name: pmbootstrap install
run: pmbootstrap -c configs/pmbootstrap.${{ matrix.arch }}.cfg -y -p pmbootstrap/cache_git/pmaports/ install --password postmarketos --no-sshd --filesystem btrfs
- name: Zip image
run: mkdir -p postmarketos-qemu-${{ matrix.arch }}/boot && sudo cp -r /home/runner/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/qemu-${{ matrix.arch }}.img postmarketos-qemu-${{ matrix.arch }}/ && cp -r /home/runner/.local/var/pmbootstrap/chroot_rootfs_qemu-${{ matrix.arch }}/boot/* postmarketos-qemu-${{ matrix.arch }}/boot/ && find postmarketos-qemu-${{ matrix.arch }}/ -print | zip postmarketos-qemu-${{ matrix.arch }}.${{ env.stamp }}.zip -@
- name: Create GH release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: postmarketos-qemu-${{ matrix.arch }}-${{ env.stamp }}
tag_name: ${{ env.stamp }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload zipped image to release artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: postmarketos-qemu-${{ matrix.arch }}.${{ env.stamp }}.zip
asset_name: postmarketos-qemu-${{ matrix.arch }}.${{ env.stamp }}.zip
asset_content_type: application/zip