Skip to content

Commit be50a57

Browse files
committed
wip
1 parent a53cbc8 commit be50a57

File tree

4 files changed

+88
-36
lines changed

4 files changed

+88
-36
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.1
1+
VERSION=v0.0.2
22
OUT_DIR=dist
33

44
CLI_NAME?=cf

build/ci.yml

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,70 @@ steps:
141141
push_quay_dev:
142142
title: push to quay
143143
registry: "${{REGISTRY_INTEGRATION_QUAY}}"
144+
145+
build_binaries:
146+
<<: *deps
147+
stage: Build
148+
title: build binaries
149+
commands:
150+
- make ./dist/cf-${TARGET}.sha256 DEV_MODE=false
151+
scale:
152+
linux_amd64:
153+
title: linux_amd64
154+
environment:
155+
- TARGET=linux-amd64
156+
linux_arm64:
157+
title: linux_arm64
158+
environment:
159+
- TARGET=linux-arm64
160+
linux_s390x:
161+
title: linux_s390x
162+
environment:
163+
- TARGET=linux-s390x
164+
linux_ppc64le:
165+
title: linux_ppc64le
166+
environment:
167+
- TARGET=linux-ppc64le
168+
windows_amd64:
169+
title: windows_amd64
170+
environment:
171+
- TARGET=windows-amd64
172+
darwin_amd64:
173+
title: darwin_amd64
174+
environment:
175+
- TARGET=darwin-amd64
176+
when:
177+
branch:
178+
only: [ "main" ]
179+
steps:
180+
- name: test
181+
on:
182+
- success
183+
- name: codegen
184+
on:
185+
- success
186+
- name: lint
187+
on:
188+
- success
189+
190+
create_release:
191+
<<: *deps
192+
stage: Release
193+
title: create github release
194+
commands:
195+
- export GIT_REPO=${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
196+
- export GIT_BRANCH=${{CF_BRANCH}}
197+
- make release
198+
when:
199+
branch:
200+
only: [ "main" ]
201+
steps:
202+
- name: build_binaries
203+
on:
204+
- success
205+
- name: build
206+
on:
207+
- success
144208

145209
push_prod:
146210
stage: Release
@@ -152,13 +216,7 @@ steps:
152216
- ${{VERSION}}
153217
when:
154218
steps:
155-
- name: build
156-
on:
157-
- success
158-
- name: codecov-report
159-
on:
160-
- success
161-
- name: codegen
219+
- name: create_release
162220
on:
163221
- success
164222
branch:

build/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ steps:
202202
- ${{CF_BRANCH_TAG_NORMALIZED}}
203203
when:
204204
steps:
205-
- name: build_binaries
205+
- name: create_release
206206
on:
207207
- success
208208
- name: build

hack/release.sh

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#!/bin/sh
2-
GIT_BRANCH=$(git rev-parse --symbolic-full-name --verify --quiet --abbrev-ref HEAD)
3-
4-
echo "$GIT_BRANCH" | grep -Eq '^v(\d+\.)?(\d+\.)?(\*|\d+)$'
5-
62
if [[ -z "$GIT_REPO" ]]; then
73
echo "error: git repo not defined"
84
exit 1
95
fi
106

7+
if [[ -z "$VERSION" ]]; then
8+
echo "error: missing VERSION"
9+
exit 1
10+
fi
11+
1112
if [[ -z "$GITHUB_TOKEN" ]]; then
1213
echo "error: GITHUB_TOKEN token not defined"
1314
exit 1
@@ -16,32 +17,25 @@ fi
1617
if [[ -z "$PRERELEASE" ]]; then
1718
PRERELEASE=false
1819
fi
20+
21+
echo "uploading files:"
22+
ls -1a ./dist/*.tar.gz ./dist/*.sha256
23+
echo ""
1924

20-
if [[ "$?" == "0" ]]; then
21-
echo "on release branch: $GIT_BRANCH"
22-
echo ""
23-
echo "uploading files:"
24-
ls -1a ./dist/*.tar.gz ./dist/*.sha256
25-
echo ""
25+
FILE="./docs/releases/release_notes.md"
26+
echo "using release notes file: ./docs/releases/release_notes.md"
27+
cat $FILE | head -n 5 && echo ...
28+
echo ""
2629

27-
FILE="./docs/releases/release_notes.md"
28-
echo "using release notes file: ./docs/releases/release_notes.md"
29-
cat $FILE | head -n 5 && echo ...
30+
if [[ "$PRE_RELEASE" ]]; then
31+
echo "using pre-release"
3032
echo ""
33+
fi
3134

32-
if [[ "$PRE_RELEASE" ]]; then
33-
echo "using pre-release"
34-
echo ""
35-
fi
36-
37-
echo "running: gh release create --repo $GIT_REPO -t $GIT_BRANCH -F $FILE --target $GIT_BRANCH --prerelease=$PRERELEASE ./dist/*.tar.gz ./dist/*.sha256"
38-
39-
if [[ "$DRY_RUN" == "1" ]]; then
40-
exit 0
41-
fi
35+
echo "gh release create --repo $GIT_REPO -t $VERSION -F $FILE --target main --prerelease=$PRERELEASE main ./dist/*.tar.gz ./dist/*.sha256"
4236

43-
gh release create --repo $GIT_REPO -t $GIT_BRANCH -F $FILE --target $GIT_BRANCH --prerelease=$PRERELEASE $GIT_BRANCH ./dist/*.tar.gz ./dist/*.sha256
44-
else
45-
echo "not on release branch: $GIT_BRANCH"
46-
exit 1
37+
if [[ "$DRY_RUN" == "1" ]]; then
38+
exit 0
4739
fi
40+
41+
gh release create --repo $GIT_REPO -t $VERSION -F $FILE --target main --prerelease=$PRERELEASE main ./dist/*.tar.gz ./dist/*.sha256

0 commit comments

Comments
 (0)