-
Notifications
You must be signed in to change notification settings - Fork 116
73 lines (71 loc) · 2.61 KB
/
build-system-image.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build ChimeraOS image
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
workflow_call:
inputs:
postfix:
type: string
description: Postfix used in release.
default: ''
jobs:
build-system-image:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.build_image.outputs.version }}
display_name: ${{ steps.build_image.outputs.display_name }}
display_version: ${{ steps.build_image.outputs.display_version }}
image_filename: ${{ steps.build_image.outputs.image_filename }}
steps:
- name: Maximize build space
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/share/java
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache
sudo rm -rf /opt/az
df -h
- uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- uses: actions/download-artifact@v4
with:
pattern: AUR-packages*
merge-multiple: true
path: aur-pkgs/
- uses: actions/download-artifact@v4
with:
pattern: Packages*
merge-multiple: true
path: pkgs/
- name: Build system image
id: build_image
run: |
docker pull ${{ steps.meta.outputs.tags }}
docker run -u root --rm --entrypoint=/workdir/build-image.sh -v $(pwd):/workdir -v $(pwd)/output:/output -v $GITHUB_OUTPUT:$GITHUB_OUTPUT -e "GITHUB_OUTPUT=$GITHUB_OUTPUT" --privileged=true ${{ steps.meta.outputs.tags }} $(echo ${GITHUB_SHA} | cut -c1-7)
echo -e "$(docker inspect --format='{{index .RepoDigests 0}}' ${{ steps.meta.outputs.tags }})" > output/container.txt
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.build_image.outputs.version }}
target_commitish: ${{ github.sha }}
name: ${{ steps.build_image.outputs.display_name }} ${{ steps.build_image.outputs.display_version }} ${{ inputs.postfix }}
draft: false
prerelease: true
fail_on_unmatched_files: true
files: |
output/${{ steps.build_image.outputs.image_filename }}
output/build_info.txt
output/sha256sum.txt
output/container.txt