diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 735a47bca2a64..ab06928ccb6f8 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -15,16 +15,6 @@ env: GOLANG_VERSION: '1.16.11' jobs: - build-docker: - name: Build Docker image - runs-on: ubuntu-latest - if: github.head_ref != '' - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Build Docker image - run: | - make image check-go: name: Ensure Go modules synchronicity runs-on: ubuntu-latest diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index a7965d3914386..a4ab156f1253d 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -4,6 +4,10 @@ on: push: branches: - master + pull_request: + branches: + - master + types: [ labeled, unlabeled, opened, synchronize, reopened ] env: GOLANG_VERSION: '1.16.11' @@ -28,9 +32,16 @@ jobs: id: image # build + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 - run: | - docker images -a --format "{{.ID}}" | xargs -I {} docker rmi {} - make image DEV_IMAGE=true DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/argoproj IMAGE_TAG=${{ steps.image.outputs.tag }} + IMAGE_PLATFORMS=linux/amd64 + if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]] + then + IMAGE_PLATFORMS=linux/amd64,linux/arm64 + fi + echo "Building image for platforms: $IMAGE_PLATFORMS" + make image DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/argoproj IMAGE_TAG=${{ steps.image.outputs.tag }} IMAGE_PLATFORMS=${IMAGE_PLATFORMS} working-directory: ./src/github.com/argoproj/argo-cd # publish @@ -41,6 +52,7 @@ jobs: docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" docker tag ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} argoproj/argocd:latest docker push argoproj/argocd:latest + if: github.event_name == 'push' env: USERNAME: ${{ secrets.USERNAME }} PASSWORD: ${{ secrets.TOKEN }} @@ -49,6 +61,7 @@ jobs: # deploy - run: git clone "https://$TOKEN@github.com/argoproj/argoproj-deployments" + if: github.event_name == 'push' env: TOKEN: ${{ secrets.TOKEN }} - run: | @@ -56,5 +69,6 @@ jobs: git config --global user.email 'ci@argoproj.com' git config --global user.name 'CI' git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ steps.image.outputs.tag }}' && git push) + if: github.event_name == 'push' working-directory: argoproj-deployments/argocd # TODO: clean up old images once github supports it: https://github.community/t5/How-to-use-Git-and-GitHub/Deleting-images-from-GitHub-Package-Registry/m-p/41202/thread-id/9811 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index de589d650e4d1..e44650c2eb97a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -188,7 +188,7 @@ jobs: set -ue git clean -fd mkdir -p dist/ - make image IMAGE_TAG="${TARGET_VERSION}" DOCKER_PUSH=false + make image IMAGE_TAG="${TARGET_VERSION}" DOCKER_PUSH=false IMAGE_PLATFORMS=linux/amd64,linux/arm64 make release-cli chmod +x ./dist/argocd-linux-amd64 ./dist/argocd-linux-amd64 version --client @@ -245,6 +245,17 @@ jobs: asset_content_type: application/octet-stream if: ${{ env.DRY_RUN != 'true' }} + - name: Upload argocd-linux-arm64 binary to release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/argocd-linux-arm64 + asset_name: argocd-linux-arm64 + asset_content_type: application/octet-stream + if: ${{ env.DRY_RUN != 'true' }} + - name: Upload argocd-darwin-amd64 binary to release assets uses: actions/upload-release-asset@v1 env: @@ -256,6 +267,17 @@ jobs: asset_content_type: application/octet-stream if: ${{ env.DRY_RUN != 'true' }} + - name: Upload argocd-darwin-arm64 binary to release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/argocd-darwin-arm64 + asset_name: argocd-darwin-arm64 + asset_content_type: application/octet-stream + if: ${{ env.DRY_RUN != 'true' }} + - name: Upload argocd-windows-amd64 binary to release assets uses: actions/upload-release-asset@v1 env: diff --git a/Dockerfile b/Dockerfile index f2411ffd5191d..f8fdc57434171 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,7 +92,7 @@ FROM docker.io/library/node:12.18.4 as argocd-ui WORKDIR /src ADD ["ui/package.json", "ui/yarn.lock", "./"] -RUN yarn install +RUN yarn install --network-timeout 100000 ADD ["ui/", "."] diff --git a/Makefile b/Makefile index ea445ee4ae7f8..7bcc3ab3a1192 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,7 @@ PATH:=$(PATH):$(PWD)/hack # docker image publishing options DOCKER_PUSH?=false IMAGE_NAMESPACE?= +IMAGE_PLATFORMS?=linux/amd64 # perform static compilation STATIC_BUILD?=true # build development images @@ -223,12 +224,12 @@ cli-local: clean-debug CGO_ENABLED=0 go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd .PHONY: release-cli -release-cli: clean-debug image - docker create --name tmp-argocd-linux $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) +release-cli: clean-debug make BIN_NAME=argocd-darwin-amd64 GOOS=darwin argocd-all + make BIN_NAME=argocd-darwin-arm64 GOOS=darwin GOARCH=arm64 argocd-all + make BIN_NAME=argocd-linux-amd64 GOOS=linux argocd-all + make BIN_NAME=argocd-linux-arm64 GOOS=linux GOARCH=arm64 argocd-all make BIN_NAME=argocd-windows-amd64.exe GOOS=windows argocd-all - docker cp tmp-argocd-linux:/usr/local/bin/argocd ${DIST_DIR}/argocd-linux-amd64 - docker rm tmp-argocd-linux .PHONY: test-tools-image test-tools-image: @@ -281,7 +282,7 @@ image: docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) -f dist/Dockerfile.dev dist else image: - docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) . + docker buildx build --platform $(IMAGE_PLATFORMS) -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) . endif @if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) ; fi diff --git a/hack/installers/checksums/awscli-linux-arm64-v2.4.6.zip.sha256 b/hack/installers/checksums/awscli-linux-arm64-v2.4.6.zip.sha256 index b8d69a75f82db..95b82cb64e00f 100644 --- a/hack/installers/checksums/awscli-linux-arm64-v2.4.6.zip.sha256 +++ b/hack/installers/checksums/awscli-linux-arm64-v2.4.6.zip.sha256 @@ -1 +1 @@ -095f5895976155ec570ea550ad81f92b88f1d55f1d7fc8813b30f329a82a83ba awscli-linux-arm64-v2.4.6.zip +095f5895976155ec570ea550ad81f92b88f1d55f1d7fc8813b30f329a82a83ba awscli-linux-arm64-v2.4.6.zip \ No newline at end of file