Sha256: 64bb12c7c23412b4676d40a79e01a09cc759b09efbf4c327956a9d698c9ea320

Contents?: true

Size: 1.12 KB

Versions: 16

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env bash

set -e

if [ -z "${TIKTOKEN_PUBLISH_KEY}" ]; then
  echo "Error: TIKTOKEN_PUBLISH_KEY is not set. This is the RubyGems API key to push the gem."
  exit 1
fi

run_id=""
# Parse arguments
while [[ "$#" -gt 0 ]]; do
  case $1 in
    --run-id)
      run_id="$2"
      shift 2
      ;;
    *)
      echo "Unknown parameter passed: $1"
      exit 1
      ;;
  esac
done

if [ -z "${run_id}" ]; then
  echo "Error: --run-id is not provided. Please provide the GitHub Action run id for the cross-compile workflow."
  exit 1
fi

version=$(grep VERSION lib/tiktoken_ruby/version.rb  | head -n 1 | cut -d'"' -f2)
echo "Building tiktoken_ruby v$version, using artifacts from run $run_id"

rm -rf pkg/cross-compiled
gh run download "$run_id" -D pkg/cross-compiled

for gem in pkg/cross-compiled/cross-gem-*/tiktoken_ruby-"$version"*.gem ; do
  echo "Publishing $gem"
  GEM_HOST_API_KEY="${TIKTOKEN_PUBLISH_KEY}" gem push "$gem" --host https://rubygems.org
done

# last but not least, the uncompiled gem
bundle exec rake package
GEM_HOST_API_KEY="${TIKTOKEN_PUBLISH_KEY}" gem push "pkg/tiktoken_ruby-$version.gem" --host https://rubygems.org

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
tiktoken_ruby-0.0.11.1 script/release
tiktoken_ruby-0.0.11.1-x86_64-linux script/release
tiktoken_ruby-0.0.11.1-x86_64-linux-musl script/release
tiktoken_ruby-0.0.11.1-x86_64-darwin script/release
tiktoken_ruby-0.0.11.1-x64-mingw-ucrt script/release
tiktoken_ruby-0.0.11.1-arm64-darwin script/release
tiktoken_ruby-0.0.11.1-arm-linux script/release
tiktoken_ruby-0.0.11.1-aarch64-linux script/release
tiktoken_ruby-0.0.11 script/release
tiktoken_ruby-0.0.11-x86_64-linux script/release
tiktoken_ruby-0.0.11-x86_64-linux-musl script/release
tiktoken_ruby-0.0.11-x86_64-darwin script/release
tiktoken_ruby-0.0.11-x64-mingw-ucrt script/release
tiktoken_ruby-0.0.11-arm64-darwin script/release
tiktoken_ruby-0.0.11-arm-linux script/release
tiktoken_ruby-0.0.11-aarch64-linux script/release