Skip to content

Commit fee62af

Browse files
fix(build): zip path
1 parent a4f456e commit fee62af

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

.github/workflows/binary-publish.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: build binary
22
on:
33
release:
44
types: [published]
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Version tag to build (e.g., 9.0.0)"
9+
required: true
10+
type: string
511

612
jobs:
713
determine_whether_to_run:
@@ -13,14 +19,26 @@ jobs:
1319
steps:
1420
- name: Check if Arc binary should be built
1521
id: check-build-arc
22+
env:
23+
INPUT_VERSION: ${{ inputs.version }}
24+
RELEASE_TAG: ${{ github.event.release.tag_name }}
1625
run: |
17-
TAG_NAME="${{ github.event.release.tag_name }}"
26+
TAG_NAME="${INPUT_VERSION:-${RELEASE_TAG}}"
1827
echo "Checking tag $TAG_NAME for ARC build"
19-
(echo "$TAG_NAME" | grep -Eq '^([8-9]|[1-9][0-9]+)\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs=false" >> $GITHUB_OUTPUT
28+
if echo "$TAG_NAME" | grep -Eq '^([8-9]|[1-9][0-9]+)\.[0-9]+\.[0-9]+$'; then
29+
echo "run_jobs=true" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "run_jobs=false" >> "$GITHUB_OUTPUT"
32+
fi
2033
2134
- name: Get the version from the tag
2235
id: get-version
23-
run: echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
36+
env:
37+
INPUT_VERSION: ${{ inputs.version }}
38+
RELEASE_TAG: ${{ github.event.release.tag_name }}
39+
run: |
40+
VERSION="${INPUT_VERSION:-${RELEASE_TAG}}"
41+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
2442
2543
build-arc:
2644
name: Build ARC binary
@@ -36,7 +54,7 @@ jobs:
3654
- name: building binaries for ami
3755
uses: appleboy/[email protected]
3856
env:
39-
VERSION: ${{ github.event.release.tag_name }}
57+
VERSION: ${{ needs.determine_whether_to_run.outputs.version }}
4058
PAT_ACCESS_TOKEN: ${{ secrets.PAT_ACCESS_TOKEN }}
4159
with:
4260
host: ${{ secrets.AWS_BUILD_HOST }}
@@ -97,8 +115,11 @@ jobs:
97115
popd >/dev/null
98116
99117
mkdir -p out
100-
zip -r "out/rs-linux-${mode}.zip" arc-noss/build arc-noss/go >/dev/null
101-
echo "Packaged out/rs-linux-${mode}.zip"
118+
# Zip without the leading arc-noss/ so the archive has build/ and go/ at root
119+
pushd arc-noss >/dev/null
120+
zip -r "../out/rs-linux-${mode}.zip" build go >/dev/null
121+
popd >/dev/null
122+
echo "Packaged out/rs-linux-${mode}.zip (root: build/, go/)"
102123
103124
# ----- Upload to GitHub release (by tag) -----
104125
owner="appbaseio"
@@ -169,13 +190,13 @@ jobs:
169190
PACKER_LOG: 1
170191
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
171192
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
172-
VERSION: ${{ github.event.release.tag_name }}
193+
VERSION: ${{ needs.determine_whether_to_run.outputs.version }}
173194

174195
# Reuse the same AWS host to build the cluster zip and upload it
175196
- name: building binaries for cluster (linux/amd64)
176197
uses: appleboy/[email protected]
177198
env:
178-
VERSION: ${{ github.event.release.tag_name }}
199+
VERSION: ${{ needs.determine_whether_to_run.outputs.version }}
179200
PAT_ACCESS_TOKEN: ${{ secrets.PAT_ACCESS_TOKEN }}
180201
with:
181202
host: ${{ secrets.AWS_BUILD_HOST }}

0 commit comments

Comments
 (0)