Skip to content

Commit

Permalink
github action: closer
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstevens19 committed Jul 2, 2024
1 parent 50c3bba commit 370a318
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ jobs:
cargo build --target "$target" "${flags[@]}"
fi
- name: List target directory contents for debugging
working-directory: cli
run: |
echo "Listing contents of target directory:"
ls -R ./target
- name: Archive binaries
working-directory: cli
id: artifacts
Expand All @@ -104,23 +98,29 @@ jobs:
shell: bash
run: |
RELEASE_DIR="${{ github.workspace }}/documentation/docs/public/releases"
mkdir -p "$RELEASE_DIR/$VERSION_NAME"
VERSION_DIR="$RELEASE_DIR/${{ github.ref_name }}"
mkdir -p "$RELEASE_DIR"
mkdir -p "$VERSION_DIR"
BUILD_DIR="./target/${TARGET}/${{ env.BUILD_TYPE }}"
BINARY_NAME="rindexer_cli"
FILE_NAME="rindexer_${PLATFORM_NAME}_${ARCH}.tar.gz"
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "$RELEASE_DIR/${PLATFORM_NAME}_${ARCH}.tar.gz" -C "$BUILD_DIR" "$BINARY_NAME"
cp $BUILD_DIR/$BINARY_NAME "$RELEASE_DIR/$VERSION_NAME/"
echo "file_name=${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
tar -czvf "$RELEASE_DIR/$FILE_NAME" -C "$BUILD_DIR" "$BINARY_NAME"
tar -czvf "$VERSION_DIR/$FILE_NAME" -C "$BUILD_DIR" "$BINARY_NAME"
cp "$BUILD_DIR/$BINARY_NAME" "$VERSION_DIR/"
echo "file_name=$FILE_NAME" >> $GITHUB_OUTPUT
elif [ "$PLATFORM_NAME" == "darwin" ]; then
tar -czvf "$RELEASE_DIR/${PLATFORM_NAME}_${ARCH}.tar.gz" -C "$BUILD_DIR" "$BINARY_NAME"
cp $BUILD_DIR/$BINARY_NAME "$RELEASE_DIR/$VERSION_NAME/"
echo "file_name=${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
tar -czvf "$RELEASE_DIR/$FILE_NAME" -C "$BUILD_DIR" "$BINARY_NAME"
tar -czvf "$VERSION_DIR/$FILE_NAME" -C "$BUILD_DIR" "$BINARY_NAME"
cp "$BUILD_DIR/$BINARY_NAME" "$VERSION_DIR/"
echo "file_name=$FILE_NAME" >> $GITHUB_OUTPUT
else
cd $BUILD_DIR
7z a -tzip "$RELEASE_DIR/${PLATFORM_NAME}_${ARCH}.zip" "$BINARY_NAME"
cp $BINARY_NAME "$RELEASE_DIR/$VERSION_NAME/"
echo "file_name=${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
7z a -tzip "$VERSION_DIR/${PLATFORM_NAME}_${ARCH}.zip" "$BINARY_NAME"
cp "$BINARY_NAME" "$VERSION_DIR/"
echo "file_name=rindexer_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
fi
# - name: Create release
Expand All @@ -138,7 +138,7 @@ jobs:
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add documentation/docs/public/releases
git commit -m "Add binaries for ${{ github.ref_name }}"
git commit -m "Add release binaries for ${{ github.ref_name }}"
git push origin HEAD:refs/heads/release/${{ github.ref_name }}
- name: Create or update pull request
Expand Down

0 comments on commit 370a318

Please sign in to comment.