Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alshdavid committed May 21, 2024
1 parent a1ce9df commit a507a24
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 34 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/release/publish-github-release.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@ set -ev
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR=$(dirname $(dirname $(dirname $SCRIPT_DIR)))

gh release create $MACH_VERSION --draft --notes "Automatically built binaries"
ls -l "$ROOT_DIR"
ls -l "$ROOT_DIR/artifacts"
ls -l "$ROOT_DIR/artifacts/mach-linux-amd64"

if [ "$BRANCH_NAME" == "main" ]; then
gh release edit $MACH_VERSION --title "🚀 Mach - $MACH_VERSION"
else
gh release edit $MACH_VERSION --prerelease
gh release edit $MACH_VERSION --title "🧪 Branch: $BRANCH_NAME"
fi
# gh release create $MACH_VERSION --draft --notes "Automatically built binaries"

gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-linux-amd64/mach-linux-amd64.tar.gz"
gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-linux-arm64/mach-linux-arm64.tar.gz"
gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-macos-amd64/mach-macos-amd64.tar.gz"
gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-macos-arm64/mach-macos-arm64.tar.gz"
gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-windows-amd64/mach-windows-amd64.tar.gz"
gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-windows-arm64/mach-windows-arm64.tar.gz"
# if [ "$BRANCH_NAME" == "main" ]; then
# gh release edit $MACH_VERSION --title "🚀 Mach - $MACH_VERSION"
# else
# gh release edit $MACH_VERSION --prerelease
# gh release edit $MACH_VERSION --title "🧪 Branch: $BRANCH_NAME"
# fi

gh release edit $MACH_VERSION --draft=false
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-linux-amd64/mach-linux-amd64.tar.gz"
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-linux-arm64/mach-linux-arm64.tar.gz"
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-macos-amd64/mach-macos-amd64.tar.gz"
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-macos-arm64/mach-macos-arm64.tar.gz"
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-windows-amd64/mach-windows-amd64.tar.gz"
# gh release upload $MACH_VERSION "$ROOT_DIR/artifacts/mach-windows-arm64/mach-windows-arm64.tar.gz"

# gh release edit $MACH_VERSION --draft=false

45 changes: 25 additions & 20 deletions .github/workflows/release/publish-npm-package.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@ set -ev
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR=$(dirname $(dirname $(dirname $SCRIPT_DIR)))

source $ROOT_DIR/.github/workflows/platform/unix/install-nodejs.bash
ls -l "$ROOT_DIR"
ls -l "$ROOT_DIR/artifacts"
ls -l "$ROOT_DIR/artifacts/npm-package"
ls -l "$ROOT_DIR/artifacts/mach-linux-amd64"

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> $HOME/.npmrc
# source $ROOT_DIR/.github/workflows/platform/unix/install-nodejs.bash

PACKAGES=(
"$ROOT_DIR/artifacts/npm-package/npm-mach.tgz"
"$ROOT_DIR/artifacts/mach-linux-amd64/npm-mach-linux-amd64.tgz"
"$ROOT_DIR/artifacts/mach-linux-arm64/npm-mach-linux-arm64.tgz"
"$ROOT_DIR/artifacts/mach-macos-amd64/npm-mach-macos-amd64.tgz"
"$ROOT_DIR/artifacts/mach-macos-arm64/npm-mach-macos-arm64.tgz"
"$ROOT_DIR/artifacts/mach-windows-amd64/npm-mach-windows-amd64.tgz"
"$ROOT_DIR/artifacts/mach-windows-arm64/npm-mach-windows-arm64.tgz"
)
# echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> $HOME/.npmrc

for PACKAGE in ${PACKAGES[@]}; do
if [ "$BRANCH_NAME" == "main" ]; then
echo Publishing latest tag
npm publish --access=public $PACKAGE
else
echo Publishing $BRANCH_NAME tag
npm publish --access=public --tag="$BRANCH_NAME" $PACKAGE
fi
done
# PACKAGES=(
# "$ROOT_DIR/artifacts/npm-package/npm-mach.tgz"
# "$ROOT_DIR/artifacts/mach-linux-amd64/npm-mach-linux-amd64.tgz"
# "$ROOT_DIR/artifacts/mach-linux-arm64/npm-mach-linux-arm64.tgz"
# "$ROOT_DIR/artifacts/mach-macos-amd64/npm-mach-macos-amd64.tgz"
# "$ROOT_DIR/artifacts/mach-macos-arm64/npm-mach-macos-arm64.tgz"
# "$ROOT_DIR/artifacts/mach-windows-amd64/npm-mach-windows-amd64.tgz"
# "$ROOT_DIR/artifacts/mach-windows-arm64/npm-mach-windows-arm64.tgz"
# )

# for PACKAGE in ${PACKAGES[@]}; do
# if [ "$BRANCH_NAME" == "main" ]; then
# echo Publishing latest tag
# npm publish --access=public $PACKAGE
# else
# echo Publishing $BRANCH_NAME tag
# npm publish --access=public --tag="$BRANCH_NAME" $PACKAGE
# fi
# done

0 comments on commit a507a24

Please sign in to comment.