1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-17 11:09:12 -04:00

Add container build file

This commit is contained in:
Shelikhoo
2023-02-14 23:46:45 +00:00
parent 83ea1ba3ba
commit 179cd1d62f
3 changed files with 129 additions and 0 deletions

View File

@@ -256,3 +256,68 @@ jobs:
file_glob: true
file: build_artifacts/v2ray-extra.zip
tag: ${{ github.ref }}
buildContainer:
if: github.event_name == 'release'
needs: signature
strategy:
fail-fast: false
matrix:
variant: [std, extra]
arch:
- v2Name: 32
containerName: 386
- v2Name: 64
containerName: amd64
- v2Name: arm32-v6
containerName: arm/v6
- v2Name: arm32-v7a
containerName: arm/v7
- v2Name: arm64-v8a
containerName: arm64
- v2Name: arm64-v8a
containerName: arm64/v8
name: Build And Push image
runs-on: ubuntu-latest
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
RELEASE_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
- name: Download Assets
run: |
bash ./release/container/downloadAssets.sh ${{ github.ref_name }} ${{ matrix.arch.v2Name }} ${{ matrix.arch.containerName }} ${{ matrix.variant }}
- name: Buildah Action
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: v2ray
tags: ${{ github.ref_name }}-${{ matrix.arch.v2Name }}-${{ matrix.variant }}
containerfiles: |
./release/container/Containerfile
build-args: |
TARGETPLATFORM=${{ matrix.arch.containerName }}
VARIANT=${{ matrix.variant }}
archs: ${{ matrix.arch.containerName }}
context: context/linux/${{ matrix.arch.containerName }}/${{ matrix.variant }}
extra-args: |
--squash
--timestamp 0
- name: Push To ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}