Skip to content

Commit

Permalink
build: release generation workflow (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorka-sq authored Mar 11, 2024
1 parent ed93fe5 commit 29a8082
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ _Provide a description of the overall goal (you can usually use the one from the

### Is this a rectricting or expanding change?

_[RESTRICTING|EXPANDING] Restricting changes are those that limit the current style or add new rules, while expanding changes are those that remove rules or relax the current ones._
**_[RESTRICTING|EXPANDING] change**

_Restricting changes are those that limit the current style or add new rules, while expanding changes are those that remove rules or relax the current ones._

### References
* **Issue:** _jira issue goes here, if suggesting a new feature or change, please discuss it in an issue first_
Expand All @@ -43,12 +45,3 @@ _If you find any, please describe all the special conditions._
_Automatic tests? Manual tests?_

_If it cannot be tested explain why._

_Add use cases if specs are incomplete or missing._

### How is it going to be deployed?

_If it does not require anything special, just write "Standard deployment". Otherwise, put the required steps._

- [ ] _Step 1_
- [ ] _Step 2_
20 changes: 20 additions & 0 deletions .github/workflows/pr_title_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create gem release pull request
on:
push:
branches:
- 'master'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: ruby
package-name: sequra-style
bump-minor-pre-major: true
version-file: 'lib/sequra/sequra-style/version.rb'
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
if: ${{ steps.release.outputs.release_created }}
- name: Publish gem to Github repository packages
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}
if: ${{ steps.release.outputs.release_created }}

0 comments on commit 29a8082

Please sign in to comment.