forked from openwallet-foundation/acapy
-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (140 loc) · 5.25 KB
/
Copy pathpublish.yml
File metadata and controls
155 lines (140 loc) · 5.25 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Publish ACA-Py Image
run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Image tag
required: true
type: string
ref:
description: Optional - The branch, tag or SHA to checkout.
required: false
type: string
workflow_call:
inputs:
tag:
required: true
type: string
ref:
required: false
type: string
permissions:
contents: read
jobs:
build-image:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
arch: ["amd64", "arm64"]
include:
- arch: amd64
runs-on: ubuntu-24.04
- arch: arm64
runs-on: ubuntu-24.04-arm
name: Build ACA-Py Image
runs-on: ${{ matrix.runs-on }}
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref || '' }}
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
cache-binary: false
install: true
version: latest
- name: Build and Cache Image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
push: false
context: .
file: docker/Dockerfile
build-args: |
python_version=${{ matrix.python-version }}
acapy_version=${{ inputs.tag || github.event.release.tag_name }}
cache-from: type=gha,scope=acapy-agent-${{ matrix.arch }}
cache-to: type=gha,scope=acapy-agent-${{ matrix.arch }},mode=max
platforms: linux/${{ matrix.arch }}
publish-images:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
image-type: ["standard", "bbs"]
include:
- image-type: standard
image-name: acapy-agent
# linux/386 platform support has been disabled pending a permanent fix for https://github.com/openwallet-foundation/acapy/issues/2124
# platforms: linux/amd64,linux/arm64,linux/386
platforms: linux/amd64,linux/arm64
acapy-reqs: ""
- image-type: bbs
image-name: acapy-agent-bbs
# Because of BBS, only linux/amd64 is supported for the extended image
# https://github.com/openwallet-foundation/acapy/issues/2124#issuecomment-2293569659
platforms: linux/amd64
acapy-reqs: "[askar,bbs,didcommv2]"
name: Publish ACA-Py ${{ matrix.image-type == 'bbs' && 'BBS ' || '' }} Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: build-image
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref || '' }}
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
cache-binary: false
install: true
version: latest
- name: Log in to the GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Ensure the repo owner is lowercase for the image name
- name: Lowercase Repo Owner
id: lower
run: echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT
- name: Setup Image Metadata
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
ghcr.io/${{ steps.lower.outputs.owner }}/${{ matrix.image-name }}
tags: |
type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }}
- name: Publish Image to GHCR.io
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
push: true
context: .
file: docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
python_version=${{ matrix.python-version }}
acapy_version=${{ inputs.tag || github.event.release.tag_name }}
${{ matrix.image-type == 'bbs' && 'acapy_name=acapy-agent-bbs' || '' }}
${{ matrix.acapy-reqs != '' && format('acapy_reqs={0}', matrix.acapy-reqs) || '' }}
cache-from: |
${{ matrix.image-type == 'standard' && 'type=gha,scope=acapy-agent-arm64' || '' }}
${{ matrix.image-type == 'standard' && 'type=gha,scope=acapy-agent-amd64' || '' }}
${{ matrix.image-type == 'bbs' && 'type=gha,scope=acapy-agent-bbs' || ''}}
cache-to: ${{ matrix.image-type == 'bbs' && 'type=gha,scope=acapy-agent-bbs,mode=max' || '' }}
platforms: ${{ matrix.platforms }}