Skip to content

Commit 764cf7b

Browse files
committed
ci: add release gh workflow
1 parent 946951c commit 764cf7b

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
release-please:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: googleapis/release-please-action@v4
14+
id: release
15+
16+
- name: Check out your collection repository
17+
if: ${{ steps.release.outputs.release_created }}
18+
uses: actions/checkout@v4
19+
20+
- name: Build collection
21+
if: ${{ steps.release.outputs.release_created }}
22+
id: build-collection
23+
uses: syaghoubi00/action-build-ansible-collection@v1
24+
25+
- name: Upload Release Artifact
26+
if: ${{ steps.release.outputs.release_created }}
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: gh release upload ${{ steps.release.outputs.tag_name }} ${{ steps.build-collection.outputs.artifact-filename }}
30+
31+
- name: Publish Collection to Galaxy
32+
if: ${{ steps.release.outputs.release_created }}
33+
uses: syaghoubi00/action-publish-ansible-collection@v1
34+
with:
35+
galaxy-api-key: ${{ secrets.GALAXY_API_KEY }}
36+
collection: ${{ steps.build-collection.outputs.artifact-filename }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.0"
3+
}

release-please-config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "simple",
5+
"extra-files": [
6+
{
7+
"type": "yaml",
8+
"path": "galaxy.yml",
9+
"jsonpath": "$.version"
10+
}
11+
]
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)