workflow
This commit is contained in:
parent
7fdb71b680
commit
590b1fb95d
2 changed files with 48 additions and 111 deletions
|
@ -1,11 +1,10 @@
|
||||||
# Adapted from https://github.com/andrewboring/alarm-images/blob/master/.github/workflows/build.yml
|
|
||||||
|
|
||||||
name: Build Images
|
name: Build Images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
workflow_dispatch: # Allows manual triggering
|
||||||
|
|
||||||
env:
|
env:
|
||||||
api_key: ${{ secrets.GITHUB_TOKEN }}
|
api_key: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -26,20 +25,22 @@ jobs:
|
||||||
- arch: rpi-aarch64
|
- arch: rpi-aarch64
|
||||||
flavor: xfce
|
flavor: xfce
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Configure Git user
|
- name: Configure Git user
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y parted wget dosfstools zip arch-install-scripts aria2 gh git
|
run: sudo apt-get update && sudo apt-get install -y parted wget dosfstools zip arch-install-scripts aria2 gh git
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: https://code.forgejo.org/docker/setup-qemu-action@v2
|
uses: https://github.com/docker/setup-qemu-action@v2
|
||||||
with:
|
with:
|
||||||
platforms: arm,arm64
|
platforms: arm,arm64
|
||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@ -51,18 +52,22 @@ jobs:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sudo ./create-image 9G ${{ matrix.arch }} "${scripts[@]}"
|
sudo ./create-image 9G ${{ matrix.arch }} "${scripts[@]}"
|
||||||
|
|
||||||
- name: Rename image
|
- name: Rename image
|
||||||
id: rename-image
|
id: rename-image
|
||||||
run: |
|
run: |
|
||||||
image_in_name="archlinux-${{ matrix.arch }}.img"
|
image_in_name="archlinux-${{ matrix.arch }}.img"
|
||||||
image_out_name="Parchlinux-${{ matrix.arch }}-${{ matrix.flavor }}-$(date '+%Y-%m-%d').img"
|
image_out_name="Parchlinux-${{ matrix.arch }}-${{ matrix.flavor }}-$(date '+%Y-%m-%d').img"
|
||||||
mv "$image_in_name" "$image_out_name"
|
mv "$image_in_name" "$image_out_name"
|
||||||
echo "image_name=$image_out_name" >> "$GITHUB_OUTPUT"
|
echo "image_name=$image_out_name" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Compress image
|
- name: Compress image
|
||||||
run: |
|
run: |
|
||||||
mkdir image_parts
|
mkdir image_parts
|
||||||
zip -s 2000m "image_parts/${{ steps.rename-image.outputs.image_name }}.zip" "${{ steps.rename-image.outputs.image_name }}"
|
zip -s 2000m "image_parts/${{ env.image_name }}" "${{ env.image_name }}"
|
||||||
|
|
||||||
- name: Upload image
|
- name: Upload image
|
||||||
run: |
|
run: |
|
||||||
sha256sum image_parts/* > image_parts/sha256sums.${{ matrix.arch }}.${{ matrix.flavor }}.txt
|
sha256sum image_parts/* > image_parts/sha256sums.${{ matrix.arch }}.${{ matrix.flavor }}.txt
|
||||||
gh release upload ${{ github.event.release.tag_name }} ./image_parts/* -R ${{ github.repository }}
|
gh release upload ${{ github.ref_name }} image_parts/* -R ${{ github.repository }}
|
||||||
|
|
||||||
|
|
68
.github/workflows/build.yml
vendored
68
.github/workflows/build.yml
vendored
|
@ -1,68 +0,0 @@
|
||||||
# Adapted from https://github.com/andrewboring/alarm-images/blob/master/.github/workflows/build.yml
|
|
||||||
|
|
||||||
name: Build Images
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- created
|
|
||||||
|
|
||||||
env:
|
|
||||||
api_key: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
name: ${{ github.event.repository.name }}
|
|
||||||
release_name: ${{ github.ref_name }}
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch: ['aarch64', 'rpi-aarch64']
|
|
||||||
flavor: ['barebone']
|
|
||||||
include:
|
|
||||||
- arch: rpi-aarch64
|
|
||||||
flavor: xfce
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Configure Git user
|
|
||||||
run: |
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get update && sudo apt-get install -y parted wget dosfstools zip arch-install-scripts aria2 gh git
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
with:
|
|
||||||
platforms: arm,arm64
|
|
||||||
- name: Build image
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
scripts=()
|
|
||||||
for script_name in "${{ matrix.arch }}" "${{ matrix.flavor }}" "${{ matrix.arch }}-${{ matrix.flavor }}"; do
|
|
||||||
script_path="setup/$script_name"
|
|
||||||
if [ -f "$script_path" ]; then
|
|
||||||
scripts+=("$script_path")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sudo ./create-image 9G ${{ matrix.arch }} "${scripts[@]}"
|
|
||||||
- name: Rename image
|
|
||||||
id: rename-image
|
|
||||||
run: |
|
|
||||||
image_in_name="archlinux-${{ matrix.arch }}.img"
|
|
||||||
image_out_name="Parchlinux-${{ matrix.arch }}-${{ matrix.flavor }}-$(date '+%Y-%m-%d').img"
|
|
||||||
mv "$image_in_name" "$image_out_name"
|
|
||||||
echo "image_name=$image_out_name" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Compress image
|
|
||||||
run: |
|
|
||||||
mkdir image_parts
|
|
||||||
zip -s 2000m "image_parts/${{ steps.rename-image.outputs.image_name }}.zip" "${{ steps.rename-image.outputs.image_name }}"
|
|
||||||
- name: Upload image
|
|
||||||
run: |
|
|
||||||
sha256sum image_parts/* > image_parts/sha256sums.${{ matrix.arch }}.${{ matrix.flavor }}.txt
|
|
||||||
gh release upload ${{ github.event.release.tag_name }} ./image_parts/* -R ${{ github.repository }}
|
|
Loading…
Add table
Reference in a new issue