diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b12e6d54..168890e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,9 @@ jobs: - name: Build and push image run: | - IMAGE_VERSION="$(git describe --tags --abbrev=0)" + IMAGE_V_VERSION="$(git describe --tags --abbrev=0)" + IMAGE_VERSION=${IMAGE_V_VERSION:1} + SHORT_SHA1=$(git rev-parse --short HEAD) PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64" echo "Building and pushing version ${IMAGE_VERSION} of image ${IMAGE_NAME}" diff --git a/github-action/Dockerfile b/github-action/Dockerfile index ddf7c6e5..d3839f8b 100644 --- a/github-action/Dockerfile +++ b/github-action/Dockerfile @@ -1,4 +1,4 @@ -FROM mikefarah/yq:3 +FROM mikefarah/yq:4.2.0 COPY entrypoint.sh /entrypoint.sh diff --git a/release_instructions.txt b/release_instructions.txt index 1aca267a..5e3d8bf7 100644 --- a/release_instructions.txt +++ b/release_instructions.txt @@ -1,5 +1,6 @@ - increment version in version.go - increment version in snapcraft.yaml +- increment version in github-action/Dockerfile - make sure local build passes - tag git with same version number - commit vX tag - this will trigger github actions diff --git a/scripts/publish-docker.sh b/scripts/publish-docker.sh deleted file mode 100755 index e56afd4f..00000000 --- a/scripts/publish-docker.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -ex -VERSION="$(git describe --tags --abbrev=0)" -docker build \ - --target production \ - --build-arg VERSION=${VERSION} \ - -t mikefarah/yq:latest \ - -t mikefarah/yq:${VERSION} \ - -t mikefarah/yq:4 \ - . - -trivy image mikefarah/yq:${VERSION} \ No newline at end of file diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index c169aa2d..00000000 --- a/scripts/release.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -ex -GITHUB_TOKEN="${GITHUB_TOKEN:?missing required input \'GITHUB_TOKEN\'}" - -CURRENT="$(git describe --tags --abbrev=0)" -PREVIOUS="$(git describe --tags --abbrev=0 --always "${CURRENT}"^)" -OWNER="mikefarah" -REPO="yq" - -release() { - github-release release \ - --user "$OWNER" \ - --draft \ - --repo "$REPO" \ - --tag "$CURRENT" -} - - - -release - diff --git a/scripts/upload.sh b/scripts/upload.sh deleted file mode 100755 index 7498c2f4..00000000 --- a/scripts/upload.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -ex -GITHUB_TOKEN="${GITHUB_TOKEN:?missing required input \'GITHUB_TOKEN\'}" - -CURRENT="$(git describe --tags --abbrev=0)" -PREVIOUS="$(git describe --tags --abbrev=0 --always "${CURRENT}"^)" -OWNER="mikefarah" -REPO="yq" - -upload() { - mkdir -p ./build-done - while IFS= read -r -d $'\0'; do - file=$REPLY - BINARY=$(basename "${file}") - echo "--> ${BINARY}" - github-release upload \ - --replace \ - --user "$OWNER" \ - --repo "$REPO" \ - --tag "$CURRENT" \ - --name "${BINARY}" \ - --file "$file" - mv "$file" "./build-done/${BINARY}" - done < <(find ./build -mindepth 1 -maxdepth 1 -print0) -} - - -upload