File: upload-release-steps

package info (click to toggle)
ruby-pdf-reader 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,512 kB
  • sloc: ruby: 11,959; sh: 46; makefile: 11
file content (23 lines) | stat: -rwxr-xr-x 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

set -euo pipefail

#if [ "${BUILDKITE_BRANCH}" != "main" ]; then
#  echo "Non main branch, skipping release"
#  exit
#fi

GEMSPEC_PATH="$(dirname $0)/../pdf-reader.gemspec"

RELEASE_VERSION=$(grep "spec.version =" $GEMSPEC_PATH | sed -r 's/.*spec.version = "([^"]+)".*/\1/')

echo "version: ${RELEASE_VERSION}"

if [ $(curl -s -o /dev/null -w "%{http_code}" https://rubygems.org/api/v2/rubygems/pdf-reader/versions/${RELEASE_VERSION}.json) == "200" ]; then
  echo "Gem version ${RELEASE_VERSION} already found on rubygems, skipping release"
  exit
fi

export RELEASE_VERSION

cat $(dirname $0)/../.buildkite/pipeline.release.yml | sed -r 's/__TEMPLATE__/${RELEASE_VERSION}/' | buildkite-agent pipeline upload