Skip to content

Commit 907b4e5

Browse files
committed
ci: splits release
1 parent 44011aa commit 907b4e5

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77

88
permissions:
99
contents: write # required to write to github release.
10+
packages: write
11+
actions: write
1012

1113
jobs:
1214
release:
@@ -42,3 +44,39 @@ jobs:
4244
PROD_REGISTRY: "ghcr.io/nutanix-cloud-native"
4345
GH_ORG_NAME: nutanix-cloud-native
4446
TAG: ${{ env.RELEASE_TAG }}
47+
images:
48+
name: Push images
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: checkout code
52+
uses: actions/checkout@v5
53+
with:
54+
fetch-depth: 0
55+
- name: Set up Go
56+
uses: actions/setup-go@v6
57+
with:
58+
go-version: '1.24'
59+
- name: Login to GitHub Container Registry
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ghcr.io
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
- name: Set version info
66+
run: |
67+
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
68+
# NB: this gets the closest tag cut from the same branch; for new minor tags, it will find the previous minor, not the previous patch release
69+
# (for example v2.7.0, not v2.7.3). For new patch releases, it should fetch the previous patch (e.g. 2.7.3, not v2.7.0)
70+
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
71+
echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV
72+
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
73+
- name: Push docker images
74+
run: |
75+
make docker-build-all
76+
make docker-push-all
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
REGISTRY: "ghcr.io/nutanix-cloud-native"
80+
PROD_REGISTRY: "ghcr.io/nutanix-cloud-native"
81+
GH_ORG_NAME: nutanix-cloud-native
82+
TAG: ${{ env.RELEASE_TAG }}

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,6 @@ release: clean-release check-release-tag check-release-branch $(RELEASE_DIR) $(G
587587
CORE_CONTROLLER_IMG=$(PROD_REGISTRY)/$(CORE_IMAGE_NAME) $(MAKE) release-manifests
588588
$(MAKE) release-policies
589589
$(GORELEASER) release --config $(GORELEASER_CONFIG) --release-notes $(RELEASE_DIR)/CHANGELOG.md --clean --parallelism $(GORELEASER_PARALLELISM)
590-
$(MAKE) docker-build-all
591-
$(MAKE) docker-push-all
592590

593591
release-policies: $(RELEASE_POLICIES) ## Release policies
594592

0 commit comments

Comments
 (0)