From 5bfdaf1aa72d745c60d243b9c9d030e130f38ad7 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Fri, 24 Feb 2023 13:58:06 -0500 Subject: [PATCH] add automation for publishing this gem (#13) --- .github/workflows/publish.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..84853ca --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Publish Gem + +on: + push: + tags: + - "*" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Set version + id: version + run: echo "version=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT + + - name: checkout + uses: actions/checkout@v3 + + - name: Setup Ruby using Bundler + uses: ruby/setup-ruby@v1 + with: + ruby-version: "2.7.1" + bundler-cache: true + bundler: "2.1.4" + + - name: install gems + run: bundle install + + - name: Setup Rubygems credentials + run: | + set +x + mkdir -p ~/.gem + cat << EOF > ~/.gem/credentials + --- + :rubygems_api_key: ${{ secrets.OSC_ROBOT_RUBYGEMS_TOKEN }} + EOF + chmod 0600 ~/.gem/credentials + + - name: Publish Gem + run: | + bundle exec rake build + gem push pkg/ood_support-${{ steps.version.outputs.version }}.gem