Skip to content

Commit

Permalink
actions: fix archlinux missing arm64 platform
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyifan committed Dec 22, 2021
1 parent c9690d9 commit 7cc3554
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ jobs:
matrix:
include:
- image: alpine
platform: linux/amd64,linux/arm64
- image: centos
platform: linux/amd64,linux/arm64
- image: debian
platform: linux/amd64,linux/arm64
- image: fedora
platform: linux/amd64,linux/arm64
- image: ubuntu
platform: linux/amd64,linux/arm64
- image: archlinux
platform: linux/amd64

steps:
- uses: actions/checkout@v2
Expand All @@ -32,6 +38,7 @@ jobs:
- run: ./ci-helpers/build.sh
env:
IMAGE: ${{ matrix.image }}
PLATFORM: ${{ matrix.platform }}
SOURCE_IMAGE: ${{ matrix.source_image }}
SKIP_REMOVE: false
DOCKER_PUSH: "${{ github.ref == 'refs/heads/master' && '--push' || '' }}"
Expand Down
7 changes: 4 additions & 3 deletions ci-helpers/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

image=$1
tag=$2
source_image=${3:-$image}
platform=$3
source_image=${4:-$image}
version=$(git tag --contains | tr 'v' '-')

if [[ $image == ubuntu ]]; then
Expand Down Expand Up @@ -31,12 +32,12 @@ EOF
cd $workdir
docker buildx build \
-t smartentry/$image:$tag \
--platform linux/amd64,linux/arm64 \
--platform $platform \
$DOCKER_PUSH .

[[ -n $version ]] && docker buildx build \
-t smartentry/$image:$tag$version \
--platform linux/amd64,linux/arm64 \
--platform $platform \
$DOCKER_PUSH .

[[ $SKIP_REMOVE == true ]] || docker buildx prune -a -f
2 changes: 1 addition & 1 deletion ci-helpers/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ docker_tags () {
}

[[ -z $SKIP_LOGIN ]] && docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
docker_tags ${SOURCE_IMAGE:-$IMAGE} | parallel --retries 3 -j 8 $BASEDIR/build-image.sh $IMAGE {} $SOURCE_IMAGE
docker_tags ${SOURCE_IMAGE:-$IMAGE} | parallel --retries 3 -j 8 $BASEDIR/build-image.sh $IMAGE {} $PLATFORM $SOURCE_IMAGE

0 comments on commit 7cc3554

Please sign in to comment.