Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ruby:2 | ||
|
||
WORKDIR /github/workspace | ||
COPY ./entrypoint.rb /entrypoint.rb | ||
RUN chmod +x /entrypoint.rb | ||
ENTRYPOINT [ "/entrypoint.rb" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env ruby | ||
|
||
version = (ENV['REF'] || ENV['GITHUB_REF'] || '').sub(%r{\Arefs/tags/v}, '') | ||
log = File.read(ENV['CHANGELOG'] || Dir.glob('CHANGELOG*').first) | ||
rlsfile = ENV['RELEASE_FILE'] || '/github/home/.releasenotes' | ||
|
||
match = /^#\s*\[#{version}\]\s+-\s+(?<title>.+?)\r?\n(?<body>.*?)\r?\n#/ms.match(log) | ||
unless match | ||
puts "No Changelog notes found for v#{version}" | ||
exit 78 | ||
end | ||
|
||
title = "Release: v#{version} (#{match.named_captures['title'].strip})" | ||
body = match.named_captures['body'].strip | ||
notes = "#{title}\n\n#{body}" | ||
|
||
puts "Release Notes for v#{version}:" | ||
puts "" | ||
puts notes | ||
|
||
File.open(rlsfile, 'w') {|f| f.write(notes) } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ruby:2 | ||
ENV BUNDLE_PATH=/github/home/.bundle | ||
ENTRYPOINT sh -c "bundle install" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ruby:2 | ||
ENV BUNDLE_PATH=/github/home/.bundle | ||
ENTRYPOINT sh -c "bundle exec rake gem && bundle exec rake install" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine:latest | ||
|
||
LABEL "com.github.actions.name"="GitHub Release" | ||
LABEL "com.github.actions.description"="Create a GitHub release" | ||
LABEL "com.github.actions.icon"="command" | ||
LABEL "com.github.actions.color"="blue" | ||
LABEL "maintainer"="Loren Segal <lsegal@soen.ca>" | ||
|
||
RUN apk add --no-cache -U \ | ||
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
hub git | ||
|
||
WORKDIR /github/workspace | ||
COPY ./entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT [ "/entrypoint.sh" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
export GITHUB_TOKEN=${RELEASE_TOKEN:-$GITHUB_TOKEN} | ||
export TAG=${GITHUB_REF#refs/tags/} | ||
|
||
hub release create -a $ARTIFACT -F ${RELEASE_FILE:-/github/home/.releasenotes} $TAG |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ruby:2 | ||
ENV BUNDLE_PATH=/github/home/.bundle | ||
ENTRYPOINT sh -c "bundle exec rake" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
workflow "Build, Test, and Publish" { | ||
on = "push" | ||
resolves = ["Package Gem", "Publish Gem", "Create GitHub Release"] | ||
} | ||
|
||
action "Install" { | ||
uses = "./.github/actions/install" | ||
} | ||
|
||
action "Test" { | ||
needs = "Install" | ||
uses = "./.github/actions/test" | ||
} | ||
|
||
action "Package Gem" { | ||
needs = "Test" | ||
uses = "./.github/actions/package" | ||
} | ||
|
||
action "On Tag" { | ||
needs = "Package Gem" | ||
uses = "actions/bin/filter@master" | ||
args = "tag v*" | ||
} | ||
|
||
action "Release Notes" { | ||
needs = "On Tag" | ||
uses = "./.github/actions/changelog" | ||
} | ||
|
||
action "Create GitHub Release" { | ||
needs = "Release Notes" | ||
uses = "./.github/actions/release" | ||
secrets = ["RELEASE_TOKEN"] | ||
} | ||
|
||
action "Publish Gem" { | ||
needs = "On Tag" | ||
uses = "scarhand/actions-ruby@master" | ||
args = "push *.gem" | ||
secrets = ["RUBYGEMS_AUTH_TOKEN"] | ||
} |