Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 2792005

Browse files
authored
chore(semantic-release): #64 - Enable semantic release (#109)
Signed-off-by: grzesuav <grzesuav@gmail.com>
1 parent b0ec696 commit 2792005

File tree

3 files changed

+71
-6
lines changed

3 files changed

+71
-6
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Test and Release (if on master)
3+
on: [push, pull_request]
4+
jobs:
5+
tests:
6+
runs-on: ubuntu-18.04
7+
strategy:
8+
matrix:
9+
test: ['unit-test', 'integration-test']
10+
name: ${{ matrix.test }}
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: setup env
15+
run: |
16+
echo "::set-env name=GOPATH::$(go env GOPATH)"
17+
echo "::add-path::$(go env GOPATH)/bin"
18+
- name: Setup go
19+
uses: actions/setup-go@v1
20+
with:
21+
go-version: 1.13.5
22+
- run: make ${{ matrix.test }}
23+
release:
24+
name: Release
25+
runs-on: ubuntu-18.04
26+
needs: ['tests']
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: 12
34+
- name: Install dependencies
35+
run: npm install ci
36+
- name: Release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
run: npx semantic-release
41+
release-docker:
42+
name: Release docke rimage
43+
runs-on: ubuntu-18.04
44+
needs: ['tests']
45+
if: startsWith(github.ref, 'refs/tags/')
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
- name: Deploy docker image
50+
uses: docker/build-push-action@v1
51+
with:
52+
username: ${{ secrets.DOCKER_USERNAME }}
53+
password: ${{ secrets.DOCKER_PASSWORD }}
54+
repository: quay.io/amitkumardas/metac
55+
registry: quay.io
56+
tag_with_ref: true
57+
add_git_labels: true
58+
push: ${{ startsWith(github.ref, 'refs/tags/') }}

hack/get-kube-binaries.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ cd hack/bin
3030
# uncomment below for mandatory download
3131
#rm -f kubectl
3232

33-
if ./kubectl version --client; then
33+
if [[ -f ./kubectl ]] && ./kubectl version --client; then
3434
echo ""
3535
echo "+++ Above kubectl was installed previously"
3636
echo ""
3737
else
38-
wget "${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/bin/linux/amd64/kubectl"
38+
wget -nv "${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/bin/linux/amd64/kubectl"
3939
chmod +x kubectl
4040
fi
4141

@@ -44,28 +44,28 @@ fi
4444
# uncomment below for mandatory download
4545
#rm -f kube-apiserver
4646

47-
if ./kube-apiserver --version; then
47+
if [[ -f ./kube-apiserver ]] && ./kube-apiserver --version; then
4848
echo ""
4949
echo "+++ Above kube-apiserver was installed previously"
5050
echo ""
5151
else
52-
wget "${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/bin/linux/amd64/kube-apiserver"
52+
wget -nv "${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}/bin/linux/amd64/kube-apiserver"
5353
chmod +x kube-apiserver
5454
fi
5555

5656
# Download etcd.
5757
# uncomment below for mandatory download
5858
#rm -f etcd
5959

60-
if ./etcd --version; then
60+
if [[ -f ./etcd ]] && ./etcd --version; then
6161
echo ""
6262
echo "+++ Above etcd was installed previously"
6363
echo ""
6464
else
6565
basename="etcd-${ETCD_VERSION}-linux-amd64"
6666
filename="${basename}.tar.gz"
6767
url="https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/${filename}"
68-
wget "${url}"
68+
wget -nv "${url}"
6969
tar -zxf "${filename}"
7070
mv "${basename}/etcd" etcd
7171
rm -rf "${basename}" "${filename}"

release.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
"branches": ["master"],
3+
"plugins": [
4+
'@semantic-release/commit-analyzer',
5+
'@semantic-release/release-notes-generator',
6+
'@semantic-release/github']
7+
}

0 commit comments

Comments
 (0)