Skip to content

Commit 32c89a1

Browse files
committed
adjust tags/dir mapping
1 parent 700b411 commit 32c89a1

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

.github/workflows/taco-release.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: taco-release
33
on:
44
push:
55
tags:
6-
- 'taco/cmd/taco/v*'
7-
- 'taco/cmd/statesman/v*'
6+
- 'taco/cli/v*'
7+
- 'taco/statesman/v*'
88

99
permissions:
1010
contents: write
@@ -56,46 +56,52 @@ jobs:
5656
- name: Derive app dir and version
5757
id: meta
5858
run: |
59-
TAG="${GITHUB_REF_NAME}" # e.g. taco/cmd/taco/v1.2.3
60-
APP_DIR="${TAG%/v*}" # taco/cmd/taco
59+
TAG="${GITHUB_REF_NAME}" # e.g. taco/cli/v1.2.3
60+
APP_DIR="${TAG%/v*}" # taco/cli
6161
VERSION="${TAG##*/}" # v1.2.3
6262
echo "app_dir=$APP_DIR" >> $GITHUB_OUTPUT
6363
echo "version=$VERSION" >> $GITHUB_OUTPUT
64+
# Map to actual directory paths
65+
if [ "$APP_DIR" = "taco/cli" ]; then
66+
echo "build_dir=taco/cmd/taco" >> $GITHUB_OUTPUT
67+
elif [ "$APP_DIR" = "taco/statesman" ]; then
68+
echo "build_dir=taco/cmd/statesman" >> $GITHUB_OUTPUT
69+
fi
6470
6571
- name: Build CLI
66-
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/taco')
67-
working-directory: taco/cmd/taco
72+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cli')
73+
working-directory: ${{ steps.meta.outputs.build_dir }}
6874
run: |
6975
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
7076
-ldflags="-X 'main.Version=${{ steps.meta.outputs.version }}' -X 'main.Commit=${{ github.sha }}' -s -w" \
7177
-o taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
7278
sha256sum taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} > taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}.sha256
7379
7480
- name: Build Statesman
75-
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/statesman')
76-
working-directory: taco/cmd/statesman
81+
if: startsWith(steps.meta.outputs.app_dir, 'taco/statesman')
82+
working-directory: ${{ steps.meta.outputs.build_dir }}
7783
run: |
7884
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \
7985
-ldflags="-X 'main.Version=${{ steps.meta.outputs.version }}' -X 'main.Commit=${{ github.sha }}' -s -w" \
8086
-o statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
8187
sha256sum statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }} > statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}.sha256
8288
8389
- name: Upload CLI artifacts
84-
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/taco')
90+
if: startsWith(steps.meta.outputs.app_dir, 'taco/cli')
8591
uses: actions/upload-artifact@v4
8692
with:
8793
name: taco-cli-${{ matrix.os }}-${{ matrix.arch }}
88-
path: taco/cmd/taco/taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}*
94+
path: ${{ steps.meta.outputs.build_dir }}/taco-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}*
8995

9096
- name: Upload Statesman artifacts
91-
if: startsWith(steps.meta.outputs.app_dir, 'taco/cmd/statesman')
97+
if: startsWith(steps.meta.outputs.app_dir, 'taco/statesman')
9298
uses: actions/upload-artifact@v4
9399
with:
94100
name: taco-statesman-${{ matrix.os }}-${{ matrix.arch }}
95-
path: taco/cmd/statesman/statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}*
101+
path: ${{ steps.meta.outputs.build_dir }}/statesman-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.goos == 'windows' && '.exe' || '' }}*
96102

97103
build-docker:
98-
if: startsWith(github.ref_name, 'taco/cmd/statesman/')
104+
if: startsWith(github.ref_name, 'taco/statesman/')
99105
runs-on: ubuntu-latest
100106
steps:
101107
- uses: actions/checkout@v4
@@ -109,7 +115,7 @@ jobs:
109115
- name: Derive version
110116
id: meta
111117
run: |
112-
TAG="${GITHUB_REF_NAME}" # e.g. taco/cmd/statesman/v1.2.3
118+
TAG="${GITHUB_REF_NAME}" # e.g. taco/statesman/v1.2.3
113119
VERSION="${TAG##*/}" # v1.2.3
114120
echo "version=$VERSION" >> $GITHUB_OUTPUT
115121
@@ -147,7 +153,7 @@ jobs:
147153
VERSION=${{ steps.meta.outputs.version }}
148154
149155
create-release-cli:
150-
if: startsWith(github.ref_name, 'taco/cmd/taco/')
156+
if: startsWith(github.ref_name, 'taco/cli/')
151157
needs: [build]
152158
runs-on: ubuntu-latest
153159
steps:
@@ -158,8 +164,8 @@ jobs:
158164
- name: Derive app dir and version
159165
id: meta
160166
run: |
161-
TAG="${GITHUB_REF_NAME}" # e.g. taco/cmd/taco/v1.2.3
162-
APP_DIR="${TAG%/v*}" # taco/cmd/taco
167+
TAG="${GITHUB_REF_NAME}" # e.g. taco/cli/v1.2.3
168+
APP_DIR="${TAG%/v*}" # taco/cli
163169
VERSION="${TAG##*/}" # v1.2.3
164170
echo "app_dir=$APP_DIR" >> $GITHUB_OUTPUT
165171
echo "version=$VERSION" >> $GITHUB_OUTPUT
@@ -196,7 +202,7 @@ jobs:
196202
prerelease: false
197203

198204
create-release-statesman:
199-
if: startsWith(github.ref_name, 'taco/cmd/statesman/')
205+
if: startsWith(github.ref_name, 'taco/statesman/')
200206
needs: [build, build-docker]
201207
runs-on: ubuntu-latest
202208
steps:
@@ -207,8 +213,8 @@ jobs:
207213
- name: Derive app dir and version
208214
id: meta
209215
run: |
210-
TAG="${GITHUB_REF_NAME}" # e.g. taco/cmd/statesman/v1.2.3
211-
APP_DIR="${TAG%/v*}" # taco/cmd/statesman
216+
TAG="${GITHUB_REF_NAME}" # e.g. taco/statesman/v1.2.3
217+
APP_DIR="${TAG%/v*}" # taco/statesman
212218
VERSION="${TAG##*/}" # v1.2.3
213219
echo "app_dir=$APP_DIR" >> $GITHUB_OUTPUT
214220
echo "version=$VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)