Skip to content

Commit 2b2e158

Browse files
authored
migrate release process to gh actions (#886)
1 parent 0adc811 commit 2b2e158

File tree

5 files changed

+61
-81
lines changed

5 files changed

+61
-81
lines changed

.circleci/config.yml

-73
This file was deleted.

.github/workflows/ci.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
if: github.repository == 'aws/eks-charts'
9+
steps:
10+
-
11+
name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-go@v3
16+
with:
17+
go-version: 1.19
18+
check-latest: true
19+
- run: make install-toolchain
20+
- run: make verify
21+
- run: make package

.github/workflows/release.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: release
2+
on:
3+
push:
4+
branches: [master]
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
permissions:
9+
id-token: write
10+
pull-requests: write
11+
contents: write
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'aws/eks-charts'
16+
steps:
17+
-
18+
name: Checkout
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-go@v3
23+
with:
24+
go-version: 1.19
25+
check-latest: true
26+
- run: make install-toolchain
27+
- run: make verify
28+
- run: make package publish
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GITHUB_REPO: ${{ github.repository }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![CircleCI](https://circleci.com/gh/aws/eks-charts.svg?style=svg)](https://circleci.com/gh/aws/eks-charts)
1+
![EKS Charts](https://github.com/aws/eks-charts/actions/workflows/ci.yaml/badge.svg)
22

33
## EKS Charts
44

scripts/publish-charts.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@ TOOLS_DIR="${BUILD_DIR}/tools"
77
STABLE="${GIT_REPO_ROOT}/stable"
88
PACKAGE_DIR="${GIT_REPO_ROOT}/build"
99
export PATH="${TOOLS_DIR}:${PATH}"
10+
VERSION="$(git describe --tags --always)"
1011

11-
if echo "${CIRCLE_TAG}" | grep -Eq "^v[0-9]+(\.[0-9]+){2}$"; then
12-
REPOSITORY="https://eks-bot:${GITHUB_TOKEN}@github.com/aws/eks-charts.git"
12+
if echo "${VERSION}" | grep -Eq "^v[0-9]+(\.[0-9]+){2}$"; then
13+
git fetch --all
1314
git config user.email [email protected]
1415
git config user.name eks-bot
15-
git remote set-url origin ${REPOSITORY}
16+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}
17+
git config pull.rebase false
1618
git checkout gh-pages
1719
mv -n $PACKAGE_DIR/stable/*.tgz .
1820
helmv3 repo index . --url https://aws.github.io/eks-charts
1921
git add .
20-
git commit -m "Publish stable charts ${CIRCLE_TAG}"
22+
git commit -m "Publish stable charts ${VERSION}"
2123
git push origin gh-pages
2224
echo "✅ Published charts"
2325
else
2426
echo "Not a valid semver release tag! Skip charts publish"
25-
# Need to exit 0 here since circle ci runs this everytime
26-
exit 0
27+
exit 1
2728
fi
28-
29+

0 commit comments

Comments
 (0)