-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (50 loc) · 2.21 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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