[RELEASE] Version 5.3.1 #3
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
name: Release and Deploy | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- lib/dragnet/version.rb | |
jobs: | |
build: | |
name: Build & Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Needed to create the tag and the release | |
id-token: write # Needed to push to rubygems.org as a trusted publisher | |
environment: release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby 2.7 | |
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 | |
with: | |
ruby-version: 2.7.7 | |
- name: Build | |
run: | | |
bundler install | |
rake clobber | |
rake build | |
- name: Get Version | |
run: | | |
echo "GEM_VERSION=$(bundler exec ruby -e 'require "dragnet/version"; print Dragnet::VERSION')" | tee -a $GITHUB_ENV | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Github Actions | |
TAG_NAME: ${{ env.GEM_VERSION }} | |
NOTES: "[Changelog](${{ github.server_url }}/${{ github.repository }}/blob/${{ env.GEM_VERSION }}/CHANGELOG.md)" | |
TITLE: Release ${{ env.GEM_VERSION }} | |
TARGET: ${{ github.ref_name }} | |
run: | | |
gh release create $TAG_NAME --notes "$NOTES" --title "$TITLE" --target $TARGET pkg/dragnet-*.gem | |
- name: Configure trusted publishing credentials | |
uses: rubygems/[email protected] | |
- name: Deploy | |
run: | | |
gem push pkg/dragnet-*.gem |