-
Notifications
You must be signed in to change notification settings - Fork 18
171 lines (150 loc) · 5.25 KB
/
main.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: tools
on: [push, pull_request]
jobs:
release:
name: Release
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: compile tools
run: make clean all
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: c${{ github.sha }}
release_name: Release c${{ github.sha }}
draft: false
prerelease: false
- uses: actions/upload-release-asset@v1
name: release process-version function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/process-version/process-version.zip
asset_name: process-version.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release check-pkg-updates function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/check-pkg-updates/check-pkg-updates.zip
asset_name: check-pkg-updates.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release kv-pump function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/kv-pump/kv-pump.zip
asset_name: kv-pump.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release algolia-pump function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/algolia-pump/algolia-pump.zip
asset_name: algolia-pump.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release r2-pump function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/r2-pump/r2-pump.zip
asset_name: r2-pump.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release force-update function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/force-update/force-update.zip
asset_name: force-update.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
name: release checker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/checker
asset_name: checker
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1
name: release process-version-host
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/process-version-host
asset_name: process-version-host
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1
name: release git-sync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/git-sync
asset_name: git-sync
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1
name: release r2-pump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/r2-pump
asset_name: r2-pump
asset_content_type: application/octet-stream
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: compile tools
run: make all
- name: run tests
run: make test
lint:
name: golint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
register_docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Docker registry
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ github.token }}
registry: ghcr.io
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/process-version/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/tools:c${{ github.sha }}