-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (76 loc) · 2.97 KB
/
build_rechunk.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Publish rechunk to GHCR
on:
workflow_dispatch:
inputs:
tag:
description: 'The version to tag the package with:'
required: true
x86:
description: 'Build only for x86_64'
type: boolean
default: false
release:
types: [published]
permissions:
contents: read
jobs:
deploy_ghcr:
permissions:
# contents: write
packages: write
environment: prod
strategy:
fail-fast: false
matrix:
arch: ${{ github.event.inputs.x86 == 'true' && fromJSON('["x86_64"]') || fromJSON('["aarch64", "x86_64"]') }}
fedora_version: [41]
runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-24.04' }}
steps:
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io -u ${{ github.actor }} --password-stdin
- uses: actions/checkout@v3
- name: Build Image
run: |
sudo podman build --tag 'fedora_build' .
- name: Upload Image
id: upload
shell: bash
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
VERSION="${{ github.event.inputs.tag }}"
elif [[ -n "${{ github.event.release.tag_name }}" ]]; then
VERSION="${{ github.event.release.tag_name }}"
else
echo "No version tag provided"
exit 1
fi
sudo podman tag fedora_build ghcr.io/hhd-dev/rechunk:$VERSION-${{ matrix.arch }}
sudo podman push ghcr.io/hhd-dev/rechunk:$VERSION-${{ matrix.arch }}
deploy_combined_ghcr:
runs-on: ubuntu-24.04
needs: [deploy_ghcr]
permissions:
packages: write
steps:
- name: Login to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push Manifest
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
VERSION="${{ github.event.inputs.tag }}"
elif [[ -n "${{ github.event.release.tag_name }}" ]]; then
VERSION="${{ github.event.release.tag_name }}"
else
echo "No version tag provided"
exit 1
fi
sudo podman manifest create rechunk
SHA=$(sudo skopeo inspect docker://ghcr.io/hhd-dev/rechunk:$VERSION-x86_64 | jq --raw-output ".Digest")
sudo podman manifest add rechunk ghcr.io/hhd-dev/rechunk@$SHA --arch amd64
if [[ "${{ github.event.inputs.x86 }}" != "true" ]]; then
SHA=$(sudo skopeo inspect docker://ghcr.io/hhd-dev/rechunk:$VERSION-aarch64 | jq --raw-output ".Digest")
sudo podman manifest add rechunk ghcr.io/hhd-dev/rechunk@$SHA --arch arm64
fi
sudo podman manifest push --all=false rechunk ghcr.io/hhd-dev/rechunk:latest
sudo podman manifest push --all=false rechunk ghcr.io/hhd-dev/rechunk:stable
sudo podman manifest push --all=false rechunk ghcr.io/hhd-dev/rechunk:$VERSION