-
-
Notifications
You must be signed in to change notification settings - Fork 154
105 lines (95 loc) · 2.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
on:
push:
branches:
- '*--auto-release'
- master
- production
name: release
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: setup Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go
- name: check out
uses: actions/checkout@master
- name: kind create a k8s cluster
run: |
kind create cluster
# - name: lint
# run: |
# docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint \
# golangci-lint run -v
- name: unit test
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
# export KUBECONFIG="$(kind get kubeconfig-path)"
make unit-test
- name: build fx
run: |
make build
- name: test fx cli
run: |
echo $KUBECONFIG
unset KUBECONFIG
make cli-test
- name: test AKS
env:
AKS_KUBECONFIG: ${{ secrets.AKS_KUBECONFIG }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "skip since aks environment not ready yet"
# export KUBECONFIG=${HOME}/.kube/aks
# echo ${AKS_KUBECONFIG} | base64 -d > $KUBECONFIG
# DEBUG=true ./build/fx up -n hello -p 12345 examples/functions/JavaScript/func.js
# ./build/fx down hello
# rm ${KUBECONFIG}
Release:
runs-on: ${{ matrix.os }}
needs: [Test]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - macOS-latest
# - windows-latest
version:
- latest
# - v0.117.0
steps:
- name: setup Go
uses: actions/setup-go@v1
with:
go-version: '1.12'
- name: checkout
uses: actions/checkout@v1
- name: release
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Minghe Huang"
commit=$(git rev-parse --short HEAD)
version=$(cat fx.go| grep 'const version' | awk -F'"' '{print $2}')
echo "workflow is running on branch ${GITHUB_REF}"
if [[ ${GITHUB_REF} == "refs/heads/master" ]];then
version=${version}-alpha.${commit}
echo "alpha release $version"
elif [[ "${GITHUB_REF}" == *--auto-release ]];then
version=${version}-alpha.${commit}
echo "alpha release $version"
elif [[ ${GITHUB_REF} == "refs/heads/production" ]];then
echo "official release $version"
else
echo "skip release on $GITHUB_REF"
exit 0
fi
git tag -a ${version} -m "auto release"
curl -sfL https://goreleaser.com/static/run | bash --