Skip to content

Commit

Permalink
Merge pull request #251 from mcorino/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mcorino authored Mar 1, 2024
2 parents e00e51b + e1f2c2e commit ad58b28
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.pkg
tag: v0.9.7
tag: ${{ github.ref }}
overwrite: true
file_glob: true

Expand All @@ -192,7 +192,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.sha
tag: v0.9.7
tag: ${{ github.ref }}
overwrite: true
file_glob: true

Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.pkg
tag: v0.9.7
tag: ${{ github.ref }}
overwrite: true
file_glob: true

Expand All @@ -265,7 +265,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pkg/*.sha
tag: v0.9.7
tag: ${{ github.ref }}
overwrite: true
file_glob: true

Expand Down
25 changes: 25 additions & 0 deletions tools/scripts/cirrus/get_release_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

require 'uri'
require 'net/https'
require 'json'

$GITHUB_TOKEN = ENV['GITHUB_TOKEN'] || ''
if $GITHUB_TOKEN.empty?
$stdout.puts 'ERROR: GitHub access token missing!'
exit(1)
end

uri = URI('https://api.github.com/repos/mcorino/wxruby3/releases/latest')
headers = {
'Accept' => 'application/vnd.github+json',
'X-GitHub-Api-Version' => '2022-11-28',
'Authorization' => "Bearer #{ENV['GITHUB_TOKEN']}"
}
rest_response = Net::HTTP.get_response(uri, headers)
if rest_response.code.to_i == 200
data = JSON.parse!(rest_response.body)
$stdout.puts data['tag_name']
else
$stdout.puts "ERROR: Cannot determine latest release [#{rest_response}]!"
exit(1)
end
35 changes: 17 additions & 18 deletions tools/scripts/cirrus/test-wxruby3-release.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#!/usr/bin/env bash

if [ "$CIRRUS_BUILD_SOURCE" == "api" ]; then
bundle install
bundle exec rake gem
if [ "$distro" == "macosx" ]; then
gem install $(echo pkg/*.gem) --no-format-executable && wxruby test --exclude=test_intl --exclude=test_media_ctrl
else
gem install $(echo pkg/*.gem) --no-format-executable && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --exclude=test_intl --exclude=test_media_ctrl
if [ "$CIRRUS_TAG" == "" ]; then
CIRRUS_TAG=$(ruby tools/scripts/cirrus/get_release_tag.rb)
rc=$?
if [ "$rc" != "0" ]; then
echo "$CIRRUS_TAG"
exit $rc
fi
fi

WXRUBY_VERSION=${CIRRUS_TAG/#v/}
if grep -q "\-[a-zA-Z]" <<< "$CIRRUS_TAG" ; then
WXRUBY_PRERELEASE="--pre"
else
WXRUBY_VERSION=${CIRRUS_TAG/#v/}
if grep -q "\-[a-zA-Z]" <<< "$CIRRUS_TAG" ; then
WXRUBY_PRERELEASE="--pre"
else
WXRUBY_PRERELEASE=""
fi
if [ "$distro" == "macosx" ]; then
gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && wxruby test --exclude=test_intl --exclude=test_media_ctrl
else
gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --exclude=test_intl --exclude=test_media_ctrl
fi
WXRUBY_PRERELEASE=""
fi
if [ "$distro" == "macosx" ]; then
gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && wxruby test --exclude=test_intl --exclude=test_media_ctrl
else
gem install wxruby3 -v "$WXRUBY_VERSION" ${WXRUBY_PRERELEASE} --no-format-executable && xvfb-run -a -s '-screen 0 1600x1200x24' wxruby test --exclude=test_intl --exclude=test_media_ctrl
fi

0 comments on commit ad58b28

Please sign in to comment.