Skip to content

Commit

Permalink
Switch release to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dnorth98 committed Aug 25, 2020
1 parent c7f21ca commit 728c7af
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 22 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: tag-and-release

on:
push:
branches:
- main
paths: 'lib/*/version.rb'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Get version
id: get_version
run: |
version_file=$(find ./lib -name version.rb)
version=$(grep VERSION $version_file |cut -f 2 -d= |tr -d \'|tr -d [:space:])
echo ::set-output name=version::$version
echo ::set-output name=version_tag::v$version
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: "${{steps.get_version.outputs.version_tag}}"

- name: Upload to Rubygems
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
set +e
mkdir -p ~/.gem
touch ~/.gem/credentials
chmod 600 ~/.gem/credentials
echo ":rubygems_api_key: ${RUBYGEMS_API_KEY}" >> ~/.gem/credentials
gemspec=$(ls *gemspec* | head -1)
gem build $gemspec
gem_name=$(ls -t *.gem | head -1)
output=$(gem push *.gem)
if [[ $output != *"Successfully"* ]]; then
echo "Error uploading to Rubygems: $output"
rm -f ~/.gem/credentials
exit 1
else
echo "Successfully uploaded to Rubygems: $output"
rm -f ~/.gem/credentials
fi
- name: Extract from changelog
id: extract_changes
run: |
# Must use a temporary file or it loses the formatting
VERSION=${{steps.get_version.outputs.version}}; awk "/## \[$VERSION\]/{flag=1;next}/## \[/{flag=0}flag" CHANGELOG.md > REL-BODY.md
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{steps.get_version.outputs.version_tag}}
artifacts: "*.gem, CHANGELOG.md"
bodyFile: "REL-BODY.md"
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

26 changes: 19 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
# Changelog

## [2.2.1]

- Switch release to github actions

## [2.2.0]
- Add `==` to `Feature` and `Conditions`

- Add `==` to `Feature` and `Conditions`

## [2.1.0]
- Add `features` parameter to `EightBall.marshall` to allow marshalling any Features, not just the ones

- Add `features` parameter to `EightBall.marshall` to allow marshalling any Features, not just the ones
from the configured Provider.

## [2.0.0]
- [BREAKING] `Parsers` have been replaced with `Marshallers`, allowing bi-directional conversions
- Added `EightBall.marshall` as a way to output the Feature list to an external format (e.g. to create a JSON file)
- Added `EightBall.features` as a shortcut to `EightBall.provider.features`
- Testing framework has been moved from Minitest to rspec
- Updated dev dependencies

- [BREAKING] `Parsers` have been replaced with `Marshallers`, allowing bi-directional conversions
- Added `EightBall.marshall` as a way to output the Feature list to an external format (e.g. to create a JSON file)
- Added `EightBall.features` as a shortcut to `EightBall.provider.features`
- Testing framework has been moved from Minitest to rspec
- Updated dev dependencies

## [1.0.5]

Security: Update rake to >= 12.3.3

## [1.0.3]

Update .travis.yml

## [1.0.2]

Update .travis.yml

## [1.0.1]

Security: Update yard 0.9.16 -> 0.9.20

## [1.0.0]

Initial release!
2 changes: 1 addition & 1 deletion lib/eight_ball/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module EightBall
VERSION = '2.2.0'
VERSION = '2.2.1'
end

0 comments on commit 728c7af

Please sign in to comment.