Skip to content

Commit 37e3d33

Browse files
authored
Merge pull request #4 from plajusticia/actions
Automatic release with Github Actions
2 parents e335ed0 + 2393b29 commit 37e3d33

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.github/workflows/cicd.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Ansible Release # feel free to pick your own name
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'galaxy.yml'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Important: This sets up your GITHUB_WORKSPACE environment variable
16+
- uses: actions/checkout@v2
17+
18+
- name: building collection
19+
run: ./build_collection.sh
20+
shell: bash
21+
22+
- name: Generate release tag
23+
id: tag
24+
run: |
25+
echo "::set-output name=release_tag::Version_$(grep -oP '^version: \K.*' ./galaxy.yml)"
26+
27+
- name: Relase new version
28+
uses: softprops/action-gh-release@v1
29+
with:
30+
tag_name: ${{ steps.tag.outputs.release_tag }}
31+
files: ./releases/*.tar.gz
32+
...

build_collection.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env bash
22

3-
ansible-galaxy collection build
3+
4+
ansible-galaxy collection build --output-path ./releases

publish_collection.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ if [ $# -ne 1 ]; then
44
echo "usage: ${0} <file.tar.gz>"
55
exit 1
66
fi
7-
ansible-galaxy collection publish ${1} -s inbound-redhat_cop
7+
ansible-galaxy collection publish ./releases/${1} -s inbound-redhat_cop
88
rm -rf ${1}

0 commit comments

Comments
 (0)