-
-
Notifications
You must be signed in to change notification settings - Fork 68
185 lines (180 loc) · 6.41 KB
/
build_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
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: 'CI+CD'
on:
release:
types: [published]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Release Version Tag (0.0.0)'
required: true
jobs:
build:
name: 'Build & Publish'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check NPM secret presence
id: checksecrets
shell: bash
run: |
if [ "$SECRET" == "" ]; then
echo "secretspresent=false" >> $GITHUB_OUTPUT
else
echo "secretspresent=true" >> $GITHUB_OUTPUT
fi
env:
SECRET: ${{ secrets.NPM_TOKEN }}
- uses: actions/[email protected]
if: ${{ steps.checksecrets.outputs.secretspresent }}
with:
node-version: 18
- name: Publish to NPM
if: ${{ steps.checksecrets.outputs.secretspresent }}
continue-on-error: true
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm install
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
node:
name: 'Build & Publish Node'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check Docker secret presence
id: checkdocker
shell: bash
run: |
if [ "$SECRET" == "" ]; then
echo "secretspresent=false" >> $GITHUB_OUTPUT
else
echo "secretspresent=true" >> $GITHUB_OUTPUT
fi
env:
SECRET: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker QEMU
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: amd64, arm64
- name: Set up Docker Buildx
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
- name: Login to DockerHub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to Docker Hub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
push: true
tags: |
qxip/qryn:latest
qxip/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
qxip/cloki:latest
qxip/cloki:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=nodejs
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
- name: Log in to the GHCR registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
file: ./Dockerfile
push: true
tags: |
ghcr.io/metrico/qryn:latest
ghcr.io/metrico/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=nodejs
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
bun:
name: 'Build & Publish Bun'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check Docker secret presence
id: checkdocker
shell: bash
run: |
if [ "$SECRET" == "" ]; then
echo "secretspresent=false" >> $GITHUB_OUTPUT
else
echo "secretspresent=true" >> $GITHUB_OUTPUT
fi
env:
SECRET: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker QEMU
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: amd64, arm64
- name: Set up Docker Buildx
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
- name: Login to DockerHub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to Docker Hub (bun)
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
file: ./Dockerfile_bun
push: true
tags: |
qxip/qryn:bun
qxip/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}-bun
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=bun
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
- name: Log in to the GHCR registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR (bun)
uses: docker/[email protected]
with:
platforms: linux/amd64, linux/arm64
file: ./Dockerfile_bun
push: true
tags: |
ghcr.io/metrico/qryn:bun
ghcr.io/metrico/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}-bun
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=bun
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}