-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.17 KB
/
cron-gh-releases.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
name: Tunnel DB - GitHub Releases
on:
schedule:
- cron: "30 */6 * * *"
workflow_dispatch:
jobs:
build:
name: Build DB
runs-on: ubuntu-latest
steps:
# Set up Go
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22
id: go
# Install bbolt
- name: Install bbolt
run: go install go.etcd.io/bbolt/cmd/[email protected]
# Check out "github-releases" branch
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: "github-releases"
fetch-depth: 0 # Fetch entire history to avoid shallow fetch issues
# Mark repository as a safe directory
- name: Mark repo as a safe directory
run: git config --global --add safe.directory /home/runner/work/tunnel-db/tunnel-db
# Retry Git fetch if checkout fails
- name: Retry Git fetch
run: |
for i in {1..5}; do
git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/github-releases*:refs/remotes/origin/github-releases* +refs/tags/github-releases*:refs/tags/github-releases* && break || sleep 15;
done
# Download vuln-list and advisories
- name: Download vuln-list and advisories
run: make db-fetch-langs db-fetch-vuln-list-main
# Build the binary
- name: Build the binary
run: make build
# Full Database
- name: Build full database
run: make db-build
- name: Compact DB
run: make db-compact
- name: Compress assets
run: make db-compress
# Light Database
- name: Build light database
run: make db-build
env:
DB_TYPE: tunnel-light
- name: Compact DB
run: make db-compact
env:
DB_TYPE: tunnel-light
- name: Compress assets
run: make db-compress
env:
DB_TYPE: tunnel-light
# Upload assets
- name: Upload assets
run: ./tunnel-db upload --dir assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
packages: write