Skip to content

Commit

Permalink
Only call rake set-version-to-timestamp if we're on a branch
Browse files Browse the repository at this point in the history
This will make it possible to build precompiled gems with the right
version tag.
  • Loading branch information
stanhu committed Aug 15, 2023
1 parent c8af978 commit 2a0ec4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/precompiled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
ruby-version: "3.2"
bundler-cache: true
- run: ./scripts/test-gem-build gems ruby
- run: ./scripts/test-gem-build gems ruby ${{github.ref_type}}
- uses: actions/upload-artifact@v3
with:
name: cruby-gem
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
run: |
docker run --rm -v "$(pwd):/re2" -w /re2 \
${DOCKER_IMAGE} \
./scripts/test-gem-build gems ${{matrix.plat}}
./scripts/test-gem-build gems ${{matrix.plat}} ${github.ref_type}}
- uses: actions/upload-artifact@v3
with:
name: "cruby-${{matrix.plat}}-gem"
Expand Down
6 changes: 5 additions & 1 deletion scripts/test-gem-build
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ set -e -u

OUTPUT_DIR=$1
BUILD_NATIVE_GEM=$2
REF_TYPE=$3

test -e /etc/os-release && cat /etc/os-release

set -x

bundle install --local || bundle install
bundle exec rake set-version-to-timestamp

if [[ "${REF_TYPE}}" != "tag" ]]; then
bundle exec rake set-version-to-timestamp
fi

if [[ "${BUILD_NATIVE_GEM}" == "ruby" ]] ; then
# TODO we're only compiling so that we retrieve tarballs, we can do better.
Expand Down

0 comments on commit 2a0ec4d

Please sign in to comment.