Skip to content

Commit 59292ee

Browse files
authored
ci: add release and publish workflows (#3)
1 parent 193e697 commit 59292ee

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: 'Publish'
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout the codebase'
13+
uses: actions/checkout@v3
14+
15+
- name: 'Publish to Ansible Galaxy'
16+
uses: robertdebock/galaxy-action@1.2.0
17+
with:
18+
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
19+
git_branch: main

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: 'Release'
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: 'Release'
11+
runs-on: ubuntu-latest
12+
# Skip running release workflow on forks
13+
if: github.repository_owner == 'antmelekhin'
14+
steps:
15+
- name: 'Checkout the codebase'
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
persist-credentials: false
20+
21+
- name: 'Semantic Release'
22+
uses: cycjimmy/semantic-release-action@v3
23+
with:
24+
semantic_version: 19.0.5
25+
extra_plugins: |
26+
@semantic-release/git@10.0.1
27+
@semantic-release/changelog@6.0.3
28+
conventional-changelog-conventionalcommits@5.0.0
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}

.releaserc.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"releaseRules": [
10+
{
11+
"type": "refactor",
12+
"release": "patch"
13+
},
14+
{
15+
"type": "style",
16+
"release": "patch"
17+
},
18+
{
19+
"type": "test",
20+
"release": "patch"
21+
}
22+
]
23+
}
24+
],
25+
"@semantic-release/release-notes-generator",
26+
"@semantic-release/github",
27+
[
28+
"@semantic-release/changelog",
29+
{
30+
"changelogFile": "CHANGELOG.md",
31+
"changelogTitle": "# Changelog"
32+
}
33+
],
34+
[
35+
"@semantic-release/git",
36+
{
37+
"assets": [
38+
"CHANGELOG.md"
39+
],
40+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
41+
}
42+
]
43+
],
44+
"ci": false
45+
}

0 commit comments

Comments
 (0)