Skip to content

Commit

Permalink
chore: CI add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
owen2345 committed Jun 8, 2021
1 parent 2508a56 commit 02f32d1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
tags: # triggered once a git tag is published
- '*'

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

# Changelog action adaptations
- name: Create required package.json
run: test -f package.json || echo '{}' >package.json
- name: Detect Previous Tag (action not detecting very well)
run: echo "::set-output name=previous_tag::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
id: tag_checker

- name: Generate Changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
with:
from-tag: ${{steps.tag_checker.outputs.previous_tag}}
to-tag: HEAD

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion e2e_tests_connector.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |spec|

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
spec.metadata['allowed_push_host'] = 'https://github.com/owen2345/e2e_tests_connector'
# spec.metadata['allowed_push_host'] = 'https://github.com/owen2345/e2e_tests_connector'
spec.required_ruby_version = '>= 2.2' # rubocop:disable Gemspec/RequiredRubyVersion
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/owen2345/e2e_tests_connector'
Expand Down

0 comments on commit 02f32d1

Please sign in to comment.