From 1c5a2ffc29e42389ef1e69356feb52b80dbfe4f7 Mon Sep 17 00:00:00 2001 From: "Kostis (Codefresh)" <39800303+kostis-codefresh@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:58:42 +0300 Subject: [PATCH 1/2] docs: added release process (#827) Signed-off-by: Kostis Kapelonis --- docs/contributing/releasing.md | 63 ++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 64 insertions(+) create mode 100644 docs/contributing/releasing.md diff --git a/docs/contributing/releasing.md b/docs/contributing/releasing.md new file mode 100644 index 00000000..0c32c45a --- /dev/null +++ b/docs/contributing/releasing.md @@ -0,0 +1,63 @@ +# Releasing + +Argo Image Updater is released in a 2 step automated fashion using GitHub actions. The release process takes about 20 minutes, sometimes a little less, depending on the performance of GitHub Actions runners. + +Releases can only be done by people that have write/commit access on the Argo Image Updater GitHub repository. + +## Introduction + +First install on your workstation the following: + +1. GoLang +1. The `git` executable +1. The [GitHub CLI](https://cli.github.com/) +1. The `semver` cli with `go install github.com/davidrjonas/semver-cli@latest` + +Then create a release branch: + +``` +git clone git@github.com:argoproj-labs/argocd-image-updater.git +git branch -b release-0.13 +git push origin release-0.13 +``` + +The release name is just an example. You should use the next number from the [previous release](https://github.com/argoproj-labs/argocd-image-updater/releases). Make sure that the branch is named as `release-X.XX` though. + +Also note that `origin` is just an example. It should be the name of your remote that holds the upstream branch of Argo Image updater. + +Finally run + +``` +./hack/create-release-pr.sh origin +``` + +Again notice that the argument must match the upstream Git remote that you used before. This [command](https://github.com/argoproj-labs/argocd-image-updater/blob/master/hack/create-release-pr.sh) will automatically create a Pull Request in GitHub with the contents of the new release. + +## Review the pull request + +Visit the Pull Request that you just created in the GitHub UI. Validate the contents of the diff to see the suggested changes. +Once you are happy with the result, approve/merge the Pull Request. + +Merging the Pull Request will start an [automated release process](https://github.com/argoproj-labs/argocd-image-updater/blob/master/.github/workflows/create-release-draft.yaml) that will build all the artifacts +and create a draft release. + +## Publish the release + +You should now have a draft release or Argo Image Updater with all required artifacts attached as binaries. + +First, attach the release notes. [GitHub can do it automatically for you](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes) by clicking the respective button +and selecting from the drop-down menu the previous release. + +Finally publish the release by clicking the green button on the bottom left of the screen. + +You are finished! + + + + + + + + + + diff --git a/mkdocs.yml b/mkdocs.yml index 00eb9c6f..f27f7dee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ nav: - Contributing: - Overview: contributing/start.md - Developing: contributing/development.md + - Releasing: contributing/releasing.md - Examples: examples/index.md - Releases ⧉: https://github.com/argoproj-labs/argocd-image-updater/releases - Roadmap ⧉: https://github.com/argoproj-labs/argocd-image-updater/milestones From 43dbd632f9e71d3ac17ff42af230c584baf98a37 Mon Sep 17 00:00:00 2001 From: "Kostis (Codefresh)" <39800303+kostis-codefresh@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:59:09 +0300 Subject: [PATCH 2/2] chore: removed unused workflow (#828) Signed-off-by: Kostis Kapelonis --- .github/workflows/init-release.yaml | 119 ---------------------------- 1 file changed, 119 deletions(-) delete mode 100644 .github/workflows/init-release.yaml diff --git a/.github/workflows/init-release.yaml b/.github/workflows/init-release.yaml deleted file mode 100644 index c2d5a96f..00000000 --- a/.github/workflows/init-release.yaml +++ /dev/null @@ -1,119 +0,0 @@ -name: Init Argo CD Image Updater Release -on: - workflow_dispatch: - inputs: - TARGET_BRANCH: - description: 'TARGET_BRANCH to checkout (e.g. release-0.14)' - required: true - type: string - - TARGET_VERSION: - description: 'TARGET_VERSION to build manifests (e.g. 0.14.0-rc1) Note: the `v` prefix is not used' - required: true - type: string - -permissions: {} - -env: - TARGET_REMOTE: upstream - TARGET_TAG: "v${{ inputs.TARGET_VERSION }}" - -jobs: - prepare-release: - permissions: - contents: write # for peter-evans/create-pull-request to create branch - pull-requests: write # for peter-evans/create-pull-request to create a PR - name: Automatically generate version and manifests on ${{ inputs.TARGET_BRANCH }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout code - uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0 - with: - fetch-depth: 0 - fetch-tags: true - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ inputs.TARGET_BRANCH }} - - - name: Check if TARGET_VERSION is well formed. - run: | - set -ue - # Target version must not contain 'v' prefix - if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then - echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2 - exit 1 - fi - if ! echo "${{ inputs.TARGET_VERSION }}" | egrep -q '^[0-9]+\.[0-9]+\.[0-9]+$'; then - echo "Error: Target version '${{ inputs.TARGET_VERSION }}' is not well-formed. Must be X.Y.Z" >&2 - exit 1 - fi - - - name: Checking for current git branch - run: | - set -ue - RELEASE_BRANCH=$(git rev-parse --abbrev-ref HEAD || true) - if [[ $RELEASE_BRANCH = release-* ]]; then - echo "*** branch is $RELEASE_BRANCH" - else - echo "Error: Branch $RELEASE_BRANCH is not release branch" >&2 - exit 1 - fi - - - name: Checking for existence of git tag - run: | - set -ue - if git show-ref --tags "${{ env.TARGET_TAG }}" --quiet; then - echo "Error: Tag with version ${{ env.TARGET_TAG }} already exists." >&2 - exit 1 - fi - - - name: Create VERSION information - run: | - set -ue - if ! test -f VERSION; then - echo "Error: You should be in repository root." >&2 - exit 1 - fi - echo "Bumping version from $(cat VERSION) to ${{ inputs.TARGET_VERSION }}" - echo "${{ inputs.TARGET_VERSION }}" > VERSION - - - name: Install Kustomize - uses: imranismail/setup-kustomize@v2 - with: - kustomize-version: '5.2.1' - - - name: Generate new set of manifests - run: | - set -ue - echo kustomize version $(kustomize version) - make manifests IMAGE_TAG="${{ env.TARGET_TAG }}" - git diff - - - name: Create pull request - id: create-pull-request - uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 - with: - commit-message: "Bump version to ${{ inputs.TARGET_VERSION }}" - title: "Bump version to ${{ inputs.TARGET_VERSION }} on ${{ inputs.TARGET_BRANCH }} branch" - body: Updating VERSION and manifests to ${{ inputs.TARGET_VERSION }} - branch: update-version - branch-suffix: random - signoff: true - labels: release - - - name: Next steps - run: | - echo "Created release PR: ${{ steps.create-pull-request.outputs.pull-request-url }}" - echo "Once this PR is merged, pull from ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}, tag the release, and build release artifacts." - echo "If everything is fine, push changes to GitHub and container registry:" - echo " git fetch ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}" - echo " git switch ${{ inputs.TARGET_BRANCH }}" - echo " git pull ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }}" - echo " git tag ${{ env.TARGET_TAG }}" - echo " make multiarch-image" - echo " make release-binaries" - echo " git push ${{ env.TARGET_REMOTE }} ${{ inputs.TARGET_BRANCH }} ${{ env.TARGET_TAG }}" - echo " make IMAGE_TAG='${{ env.TARGET_TAG }}' multiarch-image-push" - echo - echo "Then, create release tag and execute upload-multiarch-release-assets.sh" - -