forked from openwallet-foundation/acapy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openwallet-foundation#66 from Indicio-tech/test/gh…
…a-image-builds Github actions
- Loading branch information
Showing
12 changed files
with
727 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ build | |
docs | ||
dist | ||
test-reports | ||
.python-version | ||
.python-version | ||
docker | ||
env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Nightly Build (Indy) | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
NAME: aries-cloudagent-python | ||
PYTHON_VERSION: 3.7 | ||
INDY_VERSION: 1.16.0 | ||
|
||
jobs: | ||
nightly: | ||
name: Nightly (Indy) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Gather image info | ||
id: info | ||
run: | | ||
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}" | ||
- name: Check image exists | ||
id: image-exists | ||
uses: dbluhm/image-tag-exists@257851f02e3473a75719e26b5a566ea5457da4ef | ||
with: | ||
tag: ghcr.io/${{ steps.info.outputs.repo-owner }}/${{ env.NAME }}:py${{ env.PYTHON_VERSION }}-indy-${{ env.INDY_VERSION }}-nightly-${{ github.sha }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
if: steps.image-exists.outputs.exists != 'true' | ||
|
||
- name: Cache Docker layers | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Buildx | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the GitHub Container Registry | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Base Image Metadata | ||
if: steps.image-exists.outputs.exists != 'true' | ||
id: base-meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/${{ steps.info.outputs.repo-owner }}/${{ env.NAME }} | ||
tags: | | ||
type=raw,value=py${{ env.PYTHON_VERSION }}-indy-${{ env.INDY_VERSION }}-nightly | ||
type=sha,format=long,prefix=py${{ env.PYTHON_VERSION }}-indy-${{ env.INDY_VERSION }}-nightly- | ||
- name: Build and Push Base Image to ghcr.io | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
file: docker/Dockerfile.indy | ||
tags: ${{ steps.base-meta.outputs.tags }} | ||
labels: ${{ steps.base-meta.outputs.labels }} | ||
build-args: | | ||
python_version=${{ env.PYTHON_VERSION }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
if: steps.image-exists.outputs.exists != 'true' | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache-base | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Nightly Build | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
NAME: aries-cloudagent-python | ||
PYTHON_VERSION: 3.7 | ||
|
||
jobs: | ||
nightly: | ||
name: Nightly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Gather image info | ||
id: info | ||
run: | | ||
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}" | ||
- name: Check image exists | ||
id: image-exists | ||
uses: dbluhm/image-tag-exists@257851f02e3473a75719e26b5a566ea5457da4ef | ||
with: | ||
tag: ghcr.io/${{ steps.info.outputs.repo-owner }}/${{ env.NAME }}:py${{ env.PYTHON_VERSION }}-nightly-${{ github.sha }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
if: steps.image-exists.outputs.exists != 'true' | ||
|
||
- name: Cache Docker layers | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Buildx | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the GitHub Container Registry | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Base Image Metadata | ||
if: steps.image-exists.outputs.exists != 'true' | ||
id: base-meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/${{ steps.info.outputs.repo-owner }}/${{ env.NAME }} | ||
tags: | | ||
type=raw,value=py${{ env.PYTHON_VERSION }}-nightly | ||
type=sha,format=long,prefix=py${{ env.PYTHON_VERSION }}-nightly- | ||
- name: Build and Push Base Image to ghcr.io | ||
if: steps.image-exists.outputs.exists != 'true' | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
file: docker/Dockerfile | ||
tags: ${{ steps.base-meta.outputs.tags }} | ||
labels: ${{ steps.base-meta.outputs.labels }} | ||
build-args: | | ||
python_version=${{ env.PYTHON_VERSION }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
if: steps.image-exists.outputs.exists != 'true' | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache-base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Publish Indy Python | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
indy_sdk_url: | ||
description: 'Indy SDK download URL' | ||
required: false | ||
type: string | ||
indy_postgres_url: | ||
description: 'Indy postgres download URL' | ||
required: false | ||
type: string | ||
indy_version: | ||
description: 'Indy SDK Version' | ||
required: false | ||
type: string | ||
default: '1.16.0' | ||
tag: | ||
description: 'Image tag' | ||
required: false | ||
type: string | ||
|
||
env: | ||
INDY_SDK_TAG_URL: "https://codeload.github.com/hyperledger/indy-sdk/tar.gz/refs/tags/" | ||
|
||
jobs: | ||
publish-image: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
|
||
name: Publish Indy Python | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Gather image info | ||
id: info | ||
run: | | ||
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}" | ||
[ -n "${{ inputs.indy_sdk_url }}"] && echo "::set-output name=indy-sdk-url::${{ inputs.indy_sdk_url }}" | ||
[ -z "${{ inputs.indy_sdk_url }}"] && echo "::set-output name=indy-sdk-url::${{ env.INDY_SDK_TAG_URL }}v${{ inputs.indy_version }}" | ||
[ -n "${{ inputs.indy_postgres_url }}"] && echo "::set-output name=indy-postgres-url::${{ inputs.indy_postgres_url }}" | ||
[ -z "${{ inputs.indy_postgres_url }}"] && echo "::set-output name=indy-postgres-url::${{ env.INDY_SDK_TAG_URL }}v${{ inputs.indy_version }}" | ||
[ -n "${{ inputs.tag }}" ] && echo "::set-output name=tag::${{ inputs.tag }}" | ||
[ -z "${{ inputs.tag }}" ] && echo "::set-output name=tag::py${{ matrix.python-version }}-${{ inputs.indy_version }}" | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache-base | ||
key: ${{ runner.os }}-buildx-base-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-base- | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Image Metadata | ||
id: base-meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/${{ steps.info.outputs.repo-owner }}/indy-python | ||
tags: | | ||
type=raw,value=${{ steps.info.outputs.tag }} | ||
- name: Build and Push Image to ghcr.io | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
file: docker/Dockerfile.indy-base | ||
tags: ${{ steps.base-meta.outputs.tags }} | ||
labels: ${{ steps.base-meta.outputs.labels }} | ||
build-args: | | ||
python_version=${{ matrix.python-version }} | ||
indy_version=${{ inputs.indy_version }} | ||
indy_sdk_url=${{ steps.info.outputs.indy-sdk-url }} | ||
indy_postgres_url=${{ steps.info.outputs.indy-postgres-url }} | ||
cache-from: type=local,src=/tmp/.buildx-cache-base | ||
cache-to: type=local,dest=/tmp/.buildx-cache-base-new,mode=max | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache-base | ||
mv /tmp/.buildx-cache-base-new /tmp/.buildx-cache-base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Publish ACA-Py (Indy) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
indy_version: | ||
description: 'Indy SDK Version' | ||
required: false | ||
type: string | ||
default: '1.16.0' | ||
tag: | ||
description: 'Image tag' | ||
required: false | ||
type: string | ||
|
||
env: | ||
ACAPY_REQS: '[askar,bbs]' | ||
|
||
|
||
jobs: | ||
publish-image: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
|
||
name: Publish (Indy) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Gather image info | ||
id: info | ||
run: | | ||
echo "::set-output name=repo-owner::${GITHUB_REPOSITORY_OWNER,,}" | ||
echo "::set-output name=acapy-version::$(sed -ne 's/__version__ = \"\([0-9.]\+\)\"/\1/p' aries_cloudagent/version.py)" | ||
- name: Tag image | ||
id: tag | ||
run: | | ||
[ -n "${{ inputs.tag }}" ] && echo "::set-output name=tag::${{ inputs.tag }}" | ||
[ -z "${{ inputs.tag }}" ] && echo "::set-output name=tag::py${{ matrix.python-version }}-indy-${{ inputs.indy_version }}-${{ steps.info.outputs.acapy-version }}" | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-base-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-base- | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to the GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Image Metadata | ||
id: base-meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: | | ||
ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python | ||
tags: | | ||
type=raw,value=${{ steps.tag.outputs.tag }} | ||
- name: Build and Push Image to ghcr.io | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
file: docker/Dockerfile.indy | ||
tags: ${{ steps.base-meta.outputs.tags }} | ||
labels: ${{ steps.base-meta.outputs.labels }} | ||
build-args: | | ||
python_version=${{ matrix.python-version }} | ||
indy_version=${{ inputs.indy_version }} | ||
acapy_version=${{ steps.info.outputs.acapy-version }} | ||
acapy_reqs=${{ env.ACAPY_REQS }} | ||
org=${{ steps.info.outputs.repo-owner }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
|
||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
- name: Move cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
Oops, something went wrong.