Skip to content

Commit 61a18b4

Browse files
committed
ci: fix the release workflow
1) The path is incorrect because we meant to capture the value of `$PWD` _before_ and not after running `popd` 2) The `HOST` value is different on Mac OS (the OS part is "macos" instead of the expected "darwin"). There appears to be no way to get this from some structured data in stable rustc, so we resort to grep that works on all platforms
1 parent 5b804f7 commit 61a18b4

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,7 @@ jobs:
7777

7878
- id: build
7979
run: |
80-
rustc --print cfg | grep = > rustc.vars
81-
source rustc.vars
82-
83-
if [ -z "${target_env}" ]; then
84-
export HOST="${target_arch}-${target_vendor}-${target_os}"
85-
else
86-
export HOST="${target_arch}-${target_vendor}-${target_os}-${target_env}"
87-
fi
88-
80+
export HOST=$(rustc -vV | grep host: | awk '{print $2}')
8981
if [ "$HOST" = "$TARGET" ]; then
9082
cargo build --release --target ${TARGET}
9183
else
@@ -100,9 +92,8 @@ jobs:
10092
tar cvzf $ASSET_NAME xsnippet-api
10193
fi
10294
gh release upload $RELEASE_TAG $ASSET_NAME
103-
popd
104-
10595
echo "asset_path=$PWD/$ASSET_NAME" >> $GITHUB_OUTPUT
96+
popd
10697
env:
10798
ASSET_NAME: ${{ matrix.name }}
10899
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)