Skip to content

Commit

Permalink
chore: Update publish workflow to depend on main workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewelsby committed Jun 28, 2024
1 parent d636cc8 commit 7b2bc07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: CI

on: push
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
lint:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Publish Gem

on:
push:
tags:
- 'v*'
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main

jobs:
build:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,8 +22,6 @@ jobs:
echo 'gem: --no-document' >> ~/.gemrc
gem install bundler
bundle install
- name: Run tests 🧪
run: bundle exec ruby -Ilib test/*.rb
- name: Build Gem 📦
run: gem build *.gemspec
- name: Publish Gem 🚀
Expand Down

0 comments on commit 7b2bc07

Please sign in to comment.