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 authored and mudge committed Sep 7, 2023
1 parent b257f6a commit 45e9e84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,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 @@ -209,7 +209,7 @@ jobs:
- run: |
docker run --rm -v "$(pwd):/re2" -w /re2 \
"ghcr.io/rake-compiler/rake-compiler-dock-image:1.3.0-mri-${{matrix.platform}}" \
./scripts/test-gem-build gems ${{matrix.platform}}
./scripts/test-gem-build gems ${{matrix.platform}} ${{github.ref_type}}
- uses: actions/upload-artifact@v3
with:
name: "cruby-${{matrix.platform}}-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
bundle exec rake clean
Expand Down

0 comments on commit 45e9e84

Please sign in to comment.