From a507a241f95879b67016baab7e9b0161704dcea1 Mon Sep 17 00:00:00 2001 From: David Alsh Date: Tue, 21 May 2024 10:05:01 +0700 Subject: [PATCH] ci --- .../release/publish-github-release.bash | 32 +++++++------ .../release/publish-npm-package.bash | 45 ++++++++++--------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release/publish-github-release.bash b/.github/workflows/release/publish-github-release.bash index cd1c10cf..a5679988 100644 --- a/.github/workflows/release/publish-github-release.bash +++ b/.github/workflows/release/publish-github-release.bash @@ -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 diff --git a/.github/workflows/release/publish-npm-package.bash b/.github/workflows/release/publish-npm-package.bash index 41e6cba5..6b280225 100644 --- a/.github/workflows/release/publish-npm-package.bash +++ b/.github/workflows/release/publish-npm-package.bash @@ -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 \ No newline at end of file +# 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 \ No newline at end of file