From 6c2de41e24c31ae829e4abaf07087c35e6799ab1 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sun, 9 May 2021 16:44:34 +0100 Subject: [PATCH] Even more fixes this time. --- .github/workflows/release.yaml | 50 ---------------------------------- Dockerfile | 2 +- entrypoint.sh | 2 +- 3 files changed, 2 insertions(+), 52 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 589f2ca..5e92f1c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -152,56 +152,6 @@ jobs: image: "${{ needs.prepare.outputs.DOCKER_IMAGE }}:${{ needs.prepare.outputs.GITHUB_SHA }}" fail-build: true - build-action: - needs: [ prepare, test, code_scans ] - name: Docker image build (action:multiarch) - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.ACTOR }} - password: ${{ secrets.GHCR_TOKEN }} - - name: Prepare for push - id: prep - run: | - TAGS="${{ needs.prepare.outputs.DOCKER_IMAGE }}-action:${{ needs.prepare.outputs.GITHUB_SHA }},${{ needs.prepare.outputs.DOCKER_IMAGE }}-action:${{ needs.prepare.outputs.RELEASE_VERSION }},${{ needs.prepare.outputs.DOCKER_IMAGE }}-action:latest" - echo ::set-output name=tags::${TAGS} - BRANCH=$(echo ${GITHUB_REF##*/} | tr '[A-Z]' '[a-z]') - LABELS="org.opencontainers.image.revision=${{ needs.prepare.outputs.GITHUB_SHA }}" - LABELS="$LABELS,org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" - LABELS="$LABELS,org.opencontainers.image.version=$VERSION" - LABELS="$LABELS,com.github.repo.branch=$BRANCH" - LABELS="$LABELS,com.github.repo.dockerfile=Dockerfile-action" - echo ::set-output name=labels::${LABELS} - BUILD_ARGS="BRANCH=$BRANCH" - echo ::set-output name=args::${BUILD_ARGS} - - name: Build image - id: docker_build - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - platforms: linux/arm64,linux/amd64 - push: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }} - tags: ${{ steps.prep.outputs.tags }} - file: Dockerfile-action - build-args: | - GITHUB_AUTH_TOKEN=${{ secrets.GHCR_TOKEN }} - MICROSERVICE_NAME=${{ github.event.repository.name }} - GITHUB_COMMIT_NUMBER=${{ needs.prepare.outputs.GITHUB_COMMIT_NUMBER }} - GITHUB_SHA=${{ needs.prepare.outputs.GITHUB_SHA }} - ${{ steps.prep.outputs.args }} - labels: ${{ steps.prep.outputs.labels }} - no-cache: false - build-binary: needs: [ prepare, test, code_scans ] name: Binary compilation and release diff --git a/Dockerfile b/Dockerfile index 22f0b3e..f0d617f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ WORKDIR /go/src/app COPY --from=baseimg /go/src/app/semver-gen . COPY --from=baseimg /go/src/app/config-release.yaml config.yaml COPY entrypoint.sh entrypoint.sh -CMD ["./semver-gen"] \ No newline at end of file +ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 46dcdf4..19c975a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,5 +24,5 @@ if [[ ! -z "$INPUT_REPOSITORY_LOCAL" ]]; then FLAGS+=" -l" fi -OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate generate $FLAGS) +OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*) echo "::set-output name=semantic_version::$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')" \ No newline at end of file