9
9
10
10
env :
11
11
JAVA_VERSION : " 23"
12
- DOCKER_LAYER_CACHE : " /tmp/.buildx-cache"
13
- DOCKER_REGISTRY : " ghcr.io"
14
12
15
13
jobs :
16
14
set_variables :
68
66
name : " mcw.jar"
69
67
path : " target/mcw.jar"
70
68
69
+ publish_hotspot :
70
+ needs : [ "set_variables", "build_hotspot" ]
71
+ uses : " ./.github/workflows/publish.yml"
72
+ with :
73
+ JAVA_VERSION : " ${{ env.JAVA_VERSION }}"
74
+ ARTIFACT_NAME : " mcw.jar"
75
+ DOCKER_IMAGE : " ${{ needs.set_variables.outputs.docker_image }}"
76
+ DOCKER_TARGET : " hotspot"
77
+ DOCKER_TAG_CANONICAL : " ${{ needs.set_variables.outputs.build_version }}-hotspot"
78
+ DOCKER_TAG_SHORT : " ${{ needs.set_variables.outputs.image_version_short }}"
79
+
71
80
build_graal :
72
81
name : " Build (GraalVM)"
73
82
runs-on : " ubuntu-latest"
@@ -94,69 +103,16 @@ jobs:
94
103
- name : " Archive binary"
95
104
uses : " actions/upload-artifact@v4"
96
105
with :
97
- name : " mcw-${{ runner.os }}-${{ runner.arch }} "
106
+ name : " mcw-bin "
98
107
path : " target/mcw"
99
108
100
- publish :
101
- name : " Publish"
102
- runs-on : " ubuntu-latest"
103
- needs : [ "set_variables", "build_hotspot", "build_graal" ]
104
- permissions :
105
- contents : " read"
106
- packages : " write"
107
-
108
- strategy :
109
- matrix :
110
- includes :
111
- - artifact : " mcw.jar"
112
- docker_target : " hotspot"
113
- - artifact : " mcw-${{ runner.os }}-${{ runner.arch }}"
114
- docker_target : " graal"
115
-
116
- steps :
117
- - name : " Checkout repository"
118
- uses : " actions/checkout@v4"
119
- - name : " Download artifact"
120
- uses : " actions/download-artifact@v4"
121
- with :
122
- name : " ${{ matrix.artifact }}"
123
- path : " ${{ github.workspace }}/target"
124
- - name : " Set up QEMU"
125
- uses : " docker/setup-qemu-action@v3"
126
- - name : " Set up Docker Buildx"
127
- uses : " docker/setup-buildx-action@v3"
128
- - name : " Cache Docker layers"
129
- uses : " actions/cache@v4"
130
- with :
131
- path : " ${{ env.DOCKER_LAYER_CACHE }}"
132
- key : " ${{ runner.os }}-jdk-${{ env.JAVA_VERSION }}-${{ matrix.docker_target }}-${{ github.sha }}"
133
- restore-keys : |
134
- ${{ runner.os }}-jdk-${{ env.JAVA_VERSION }}-${{ matrix.docker_target }}-
135
- - name : " Log in to the Container registry"
136
- uses : " docker/login-action@v3"
137
- with :
138
- registry : " ${{ env.DOCKER_REGISTRY }}"
139
- username : " ${{ github.actor }}"
140
- password : " ${{ secrets.GITHUB_TOKEN }}"
141
- - name : " Extract metadata (tags, labels) for Docker"
142
- id : " meta"
143
- uses : " docker/metadata-action@v5"
144
- with :
145
- images : " ${{ needs.set_variables.outputs.docker_image }}"
146
- tags : |
147
- type=raw,event=push,enable=true,value=${{ needs.set_variables.outputs.build_version }}-${{ matrix.docker_target }}
148
- type=raw,event=push,enable={{ is_default_branch }},value=${{ needs.set_variables.outputs.image_version_short }}-${{ matrix.docker_target }}
149
- - name : " Build and push Docker image"
150
- uses : " docker/build-push-action@v5"
151
- with :
152
- context : " ."
153
- push : " true"
154
- platforms : " linux/amd64"
155
- provenance : false
156
- tags : ${{ steps.meta.outputs.tags }}
157
- labels : ${{ steps.meta.outputs.labels }}
158
- target : ${{ matrix.docker_target }}
159
- build-args : |
160
- JAVA_VERSION=${{ env.JAVA_VERSION }}
161
- cache-from : type=local,src=${{ env.DOCKER_LAYER_CACHE }}
162
- cache-to : type=local,dest=${{ env.DOCKER_LAYER_CACHE }}
109
+ publish_graal :
110
+ needs : [ "set_variables", "build_hotspot" ]
111
+ uses : " ./.github/workflows/publish.yml"
112
+ with :
113
+ JAVA_VERSION : " ${{ env.JAVA_VERSION }}"
114
+ ARTIFACT_NAME : " mcw-bin"
115
+ DOCKER_IMAGE : " ${{ needs.set_variables.outputs.docker_image }}"
116
+ DOCKER_TARGET : " graal"
117
+ DOCKER_TAG_CANONICAL : " ${{ needs.set_variables.outputs.build_version }}-hotspot"
118
+ DOCKER_TAG_SHORT : " ${{ needs.set_variables.outputs.image_version_short }}"
0 commit comments