Skip to content

Fix release draft script #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/create-release-draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ jobs:
run: |
make release-binaries

- name: Setup qemu
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Build and possibly push image
run: |
set -ex
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" quay.io
IMAGE_PUSH=yes make multiarch-image
working-directory: argocd-image-updater
env:
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.QUAY_TOKEN }}

- name: Create release draft
id: create-release
env:
Expand Down
22 changes: 17 additions & 5 deletions hack/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
# - install gh cli and semver-cli (go install github.com/davidrjonas/semver-cli@latest)
# - create and push "release-X.Y" branch
# - checkout this branch locally
# - run this script from repo root: ./hack/create-release-pr.sh
# - run this script from repo root: ./hack/create-release-pr.sh [REMOTE]
# - merge the PR
# It will trigger the release workflow that would create release draft on github

RELEASE_BRANCH="$(git rev-parse --abbrev-ref HEAD || true)"
set -eux
set -o pipefail


CURRENT_BRANCH="$(git branch --show-current)"

if [[ ! "$CURRENT_BRANCH" == release-* ]]; then
echo "!! Please checkout branch 'release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2
exit 1
fi

RELEASE_BRANCH="${CURRENT_BRANCH}"

### look for latest on-branch tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "*${RELEASE_BRANCH##release-}*" 2>/dev/null || true)

Expand All @@ -26,11 +35,14 @@ echo $NEW_VERSION > VERSION
IMAGE_TAG="v${NEW_VERSION}"
make manifests

REMOTE=${1:-origin}
REMOTE_URL=$(git remote get-url ${REMOTE})

git checkout -b "feat/new-version-${NEW_VERSION}"
git commit -m "Release ${NEW_VERSION}" VERSION manifests/
git push --set-upstream origin "feat/new-version-${NEW_VERSION}"
gh label --repo $(git remote get-url origin) create --force release
gh pr --repo $(git remote get-url origin) \
git push --set-upstream ${REMOTE} "feat/new-version-${NEW_VERSION}"
gh label --repo ${REMOTE_URL} create --force release
gh pr --repo ${REMOTE_URL} \
create \
--base ${RELEASE_BRANCH} \
--title "Release ${NEW_VERSION}" \
Expand Down