Skip to content

Commit 910f9cf

Browse files
committed
ci: add gh release action
1 parent 946951c commit 910f9cf

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Check out your collection repository
19+
if: ${{ steps.release.outputs.release_created }}
20+
uses: actions/checkout@v4
21+
22+
- name: Build collection
23+
if: ${{ steps.release.outputs.release_created }}
24+
id: build-collection
25+
uses: syaghoubi00/action-build-ansible-collection@v1
26+
27+
- name: Upload Release Artifact
28+
if: ${{ steps.release.outputs.release_created }}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: gh release upload ${{ steps.release.outputs.tag_name }} ${{ steps.build-collection.outputs.artifact-filename }}
32+
33+
- name: Publish Collection to Galaxy
34+
if: ${{ steps.release.outputs.release_created }}
35+
uses: syaghoubi00/action-publish-ansible-collection@v1
36+
with:
37+
galaxy-api-key: ${{ secrets.GALAXY_API_KEY }}
38+
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)