Ruby Gem to Github Package #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2023 SolarWinds, LLC. | |
# All rights reserved. | |
name: Ruby Gem to Github Package | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build + Publish to Github Package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby 3.1 and bundle | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
- name: Install gems | |
run: | | |
echo 'gem: --no-document' >> ~/.gemrc | |
bundle install | |
- name: Install swig 4.0.2 | |
run: | | |
apt udate && apt install -y --no-install-recommends bison | |
curl -SL https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz | tar xzC /tmp | |
cd /tmp/swig-4.0.2 | |
./autogen.sh && ./configure && make && sudo make install | |
cd - | |
- name: Grab current version | |
id: version | |
run: | | |
echo "gem_version=`ruby -e 'require "./lib/solarwinds_apm/version"; puts SolarWindsAPM::Version::STRING'`" >> $GITHUB_OUTPUT | |
- name: Build gem and publish to github package | |
id: gemstep | |
run: | | |
mkdir ~/.gem | |
echo -e "---\n:github: Bearer $GITHUB_SECRET_TOKEN" >> ~/.gem/credentials | |
chmod 0600 ~/.gem/credentials | |
bundle exec rake build_gem_push_to_github_package[${{ steps.version.outputs.gem_version }}] | |
env: | |
GITHUB_SECRET_TOKEN: ${{ secrets.GITHUB_TOKEN }} |