-
-
Notifications
You must be signed in to change notification settings - Fork 3
126 lines (108 loc) · 3.18 KB
/
go.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Build-n-Release
on:
release:
types: [created]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1.0.6
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Cache Flux Build
id: cacheflux
uses: actions/cache@v3.0.11
with:
path: |
flux
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-fluxpipe-${{ hashFiles('**/fluxpipe-server.go') }}
- name: Cache Status
run: |
echo ${{steps.cacheflux.outputs.cache-hit}}
- name: Get Flux
if: steps.cacheflux.outputs.cache-hit != 'true'
uses: GuillaumeFalourd/clone-github-repo-action@v2
with:
owner: 'InfluxCommunity'
repository: 'flux'
- name: Compile Flux
if: steps.cacheflux.outputs.cache-hit != 'true'
run: |
cd flux
go mod tidy
go get ./...
make
- name: Build Fluxpipe
run: |
sed -i 's:/usr/src:'`pwd`':' flux.pc
./build.sh
- name: Compress Fluxpipe
run: |
strip fluxpipe-server
strip fluxpipe-lambda
strip fluxpipelib.a
upx fluxpipe-server
- name: Get Timestamp
if: github.event_name != 'pull_request'
id: time
uses: nanzm/get-time-action@v1.1
with:
timeZone: 0
format: 'YYYYMMDDHHmmss'
- run: |
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "TIME=${{ steps.time.outputs.time }}" >> $GITHUB_ENV
- name: Upload release
if: github.event_name != 'pull_request'
uses: boxpositron/upload-multiple-releases@1.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_config: |
fluxpipe-server
fluxpipe-lambda
fluxpipelib.a
tag_name: ${{ env.VERSION }}
release_name: fluxpipe_${{ env.VERSION }}
draft: false
prerelease: false
overwrite: true
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build and push (server)
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3.0.0
with:
context: .
push: true
tags: |
ghcr.io/metrico/fluxpipe:latest
ghcr.io/metrico/fluxpipe:${{ env.VERSION }}
- name: Docker Build and push (lambda)
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3.0.0
with:
context: .
file: Dockerfile.lambda
push: true
tags: |
ghcr.io/metrico/fluxpipe-lambda:latest
ghcr.io/metrico/fluxpipe-lambda:${{ env.VERSION }}