forked from parca-dev/parca-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (101 loc) · 3.25 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Release
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
goreleaser:
name: Go binary build and release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.17
- name: Install llvm
run: sudo apt-get install llvm libelf-dev
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialize and update libbpf submodule
run: git submodule init && git submodule update
- name: Build eBPF
run: make bpf
- name: Set Env
run: echo "BPF_OUT=$(pwd)/dist" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
# BPF_OUT: ${{ env.GITHUB_WORKSPACE }}/dist
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
manifests:
name: Manifests generate and release
runs-on: ubuntu-latest
needs: goreleaser
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.17
- name: Set up Jsonnet
run: ./env.sh
- name: Generate
run: cd deploy && make --always-make vendor manifests
- name: Prepare
run: |
tar -zcvf deploy/manifests.tar.gz deploy/manifests
cp deploy/manifests/kubernetes/manifest.yaml deploy/kubernetes-manifest.yaml
cp deploy/manifests/openshift/manifest.yaml deploy/openshift-manifest.yaml
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
deploy/manifests.tar.gz
deploy/kubernetes-manifest.yaml
deploy/openshift-manifest.yaml
publish-docs:
name: Publish Docs
runs-on: ubuntu-latest
needs: manifests
steps:
- uses: actions/checkout@v3
- name: Publish Netlify
uses: netlify/actions/build@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Publish Vercel
run: |
curl -X POST "https://api.vercel.com/v1/integrations/deploy/${{ secrets.VERCEL_WEBHOOK }}"
container:
name: Container build and release
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Initialize and update libbpf submodule
run: git submodule init && git submodule update
- name: Get branch name
shell: bash
run: echo "GITHUB_BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Build container
run: make container
- name: Login to registry
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | podman login -u parca-dev --password-stdin ghcr.io
- name: Push container
if: ${{ github.event_name != 'pull_request' }}
run: |
make push-container