Skip to content

Commit 6c7ebf3

Browse files
authored
chore(ci): Automate Releases (#1366)
* Rename elixir worfklow to ci * Update branch in check_dependents * Add workflow to enforce convential commit PR titles * Add release job to ci workflow * Add release workflow * Update CONTRIBUTING * Update Debug phase to use Logger over IO.puts * Rename secret
1 parent 680575b commit 6c7ebf3

File tree

6 files changed

+60
-16
lines changed

6 files changed

+60
-16
lines changed

.github/workflows/check_dependents.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
pull_request:
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
test_dependents:
@@ -14,25 +14,25 @@ jobs:
1414
strategy:
1515
matrix:
1616
dependent:
17-
- 'absinthe_plug'
18-
- 'absinthe_phoenix'
19-
- 'absinthe_relay'
17+
- "absinthe_plug"
18+
- "absinthe_phoenix"
19+
- "absinthe_relay"
2020

2121
steps:
2222
- name: Set up Elixir
2323
uses: erlef/setup-beam@v1
2424
with:
25-
elixir-version: '1.17'
26-
otp-version: '27'
25+
elixir-version: "1.17"
26+
otp-version: "27"
2727

2828
- name: Checkout absinthe
2929
uses: actions/checkout@v4
3030

3131
- name: Checkout ${{ matrix.dependent }}
3232
uses: actions/checkout@v4
3333
with:
34-
repository: 'absinthe-graphql/${{ matrix.dependent }}'
35-
path: '${{ matrix.dependent }}'
34+
repository: "absinthe-graphql/${{ matrix.dependent }}"
35+
path: "${{ matrix.dependent }}"
3636

3737
- name: Install absinthe package dependencies
3838
run: mix deps.get

.github/workflows/elixir.yml renamed to .github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76
pull_request:
87

98
jobs:
@@ -90,3 +89,16 @@ jobs:
9089

9190
- name: Run Dialyzer
9291
run: mix dialyzer
92+
release:
93+
name: Create or Update Release PR
94+
runs-on: ubuntu-latest
95+
needs: [test]
96+
if: github.ref == 'refs/heads/main'
97+
permissions:
98+
contents: write
99+
pull-requests: write
100+
steps:
101+
- uses: googleapis/release-please-action@v4
102+
with:
103+
token: ${{ secrets.REPO_GITHUB_TOKEN }}
104+
release-type: elixir

.github/workflows/pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Validate PR Title
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, edited, reopened]
6+
7+
jobs:
8+
main:
9+
name: Validate PR title
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: read
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out
12+
uses: actions/checkout@v3
13+
14+
- name: Publish to hex.pm
15+
uses: erlangpack/github-action@v3
16+
env:
17+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Push to your fork (preferably to a non-`main` branch) and
2626

2727
[pr]: https://github.com/absinthe-graphql/absinthe/compare/
2828

29+
Ensure your pull request title follows [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) specification.
30+
2931
We'll review and answer your pull request as soon as possible. We may suggest
3032
some changes, improvements, or alternatives. Let's work through it together.
3133

lib/absinthe/phase/debug.ex

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ defmodule Absinthe.Phase.Debug do
33

44
@moduledoc false
55

6-
alias Absinthe.Blueprint
6+
require Logger
77

8-
@spec run(any, Keyword.t()) :: {:ok, Blueprint.t()}
8+
@spec run(any, Keyword.t()) :: {:ok, Absinthe.Blueprint.t()}
99
def run(input, _options \\ []) do
10-
if System.get_env("DEBUG") do
11-
IO.inspect(input, label: :debug_blueprint_output)
12-
end
13-
10+
Logger.debug("[Absinthe Blueprint]", input)
1411
{:ok, input}
1512
end
1613
end

0 commit comments

Comments
 (0)