Skip to content

Commit 38ce1d1

Browse files
committed
Trigger release process based on passing CI on main, then filter for version tags
1 parent 282d591 commit 38ce1d1

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed
Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Ruby
1+
name: CI
22

33
on:
44
push:
@@ -25,31 +25,9 @@ jobs:
2525
with:
2626
ruby-version: ${{ matrix.ruby }}
2727
bundler-cache: true
28-
- name: Run tests
29-
run: bundle exec rspec
30-
31-
type_check:
32-
name: "Type Check"
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v4
36-
- name: Set up Ruby
37-
uses: ruby/setup-ruby@v1
38-
with:
39-
bundler-cache: true
40-
ruby-version: '3.4'
4128
- name: Run static type checks
4229
run: bundle exec srb tc
43-
44-
lint:
45-
name: "Lint"
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Set up Ruby
50-
uses: ruby/setup-ruby@v1
51-
with:
52-
bundler-cache: true
53-
ruby-version: '3.4'
54-
- name: Run static type checks
30+
- name: Run lint
5531
run: bundle exec rubocop
32+
- name: Run tests
33+
run: bundle exec rspec

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
name: Release Gem
22

33
on:
4-
push:
5-
tags:
6-
- v*
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
branches:
9+
- main
710

811
permissions:
912
contents: read
1013

1114
jobs:
1215
push:
13-
if: github.repository == 'rubyatscale/query_packwerk'
16+
if: |
17+
github.event.workflow_run.conclusion == 'success' &&
18+
github.repository == 'rubyatscale/query_packwerk' &&
19+
startsWith(github.ref, 'refs/tags/v')
1420
runs-on: ubuntu-latest
1521
environment: release
1622
permissions:

0 commit comments

Comments
 (0)