1
- name : Build
1
+ name : Release
2
2
3
3
on :
4
4
push :
5
+ branches :
6
+ - " **"
5
7
tags :
6
- - " v*"
7
- workflow_dispatch :
8
+ - " v*.*.* "
9
+ pull_request :
8
10
9
11
env :
10
12
REGISTRY : ghcr.io
11
13
IMAGE_NAME : ${{ github.repository }}
12
14
13
15
jobs :
14
- build -client :
16
+ release -client :
15
17
runs-on : ubuntu-latest
16
18
strategy :
17
19
matrix :
@@ -55,20 +57,27 @@ jobs:
55
57
-o dist/wst-${{ matrix.targets.OS }}-${{ matrix.targets.ARCH }}${{ matrix.targets.EXT }} \
56
58
./client
57
59
60
+ - name : Upload Binaries
61
+ uses : actions/upload-artifact@v4
62
+ with :
63
+ name : ${{ matrix.targets.OS }}-${{ matrix.targets.ARCH }}
64
+ path : dist/*
65
+
58
66
- name : Release
67
+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
59
68
uses : softprops/action-gh-release@v2
60
69
with :
61
70
token : ${{ secrets.GITHUB_TOKEN }}
62
71
draft : false
63
- prerelease : ${{ !startsWith(github.ref, 'refs/tags/') }}
72
+ prerelease : false
64
73
append_body : false
65
74
fail_on_unmatched_files : true
66
- name : ${{ startsWith( github.ref, 'refs/tags/') && github. ref_name || 'Dev Build' }}
67
- tag_name : ${{ startsWith( github.ref, 'refs/tags/') && github. ref_name || 'dev' }}
75
+ name : ${{ github.ref_name }}
76
+ tag_name : ${{ github.ref_name }}
68
77
files : |
69
78
dist/*
70
79
71
- build -server :
80
+ release -server :
72
81
runs-on : ubuntu-latest
73
82
74
83
steps :
81
90
uses : docker/setup-buildx-action@v3
82
91
83
92
- name : Log in to the Container registry
93
+ if : github.event_name != 'pull_request'
84
94
uses : docker/login-action@v1
85
95
with :
86
96
registry : ${{ env.REGISTRY }}
@@ -89,17 +99,27 @@ jobs:
89
99
90
100
- name : Extract metadata (tags, labels) for Docker
91
101
id : meta
92
- uses : docker/metadata-action@v3
102
+ uses : docker/metadata-action@v5
93
103
with :
94
104
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
105
+ flavor : |
106
+ latest=${{ startsWith(github.ref, 'refs/tags/') }}
107
+ tags : |
108
+ type=ref,event=branch
109
+ type=ref,event=pr
110
+ type=ref,event=tag
111
+ type=semver,pattern={{version}}
112
+ type=semver,pattern={{major}}.{{minor}}
113
+ type=semver,pattern={{major}}
114
+ type=sha
95
115
96
116
- name : Build and push
97
117
id : docker_build
98
- uses : docker/build-push-action@v5
118
+ uses : docker/build-push-action@v6
99
119
with :
100
120
context : server
101
- push : true
102
121
platforms : linux/amd64,linux/arm64
122
+ push : ${{ github.event_name != 'pull_request' }}
103
123
tags : ${{ steps.meta.outputs.tags }}
104
124
labels : ${{ steps.meta.outputs.labels }}
105
125
0 commit comments