Skip to content

Commit

Permalink
Merge pull request #4 from plajusticia/actions
Browse files Browse the repository at this point in the history
Automatic release with Github Actions
  • Loading branch information
ivarmu authored Jun 28, 2022
2 parents e335ed0 + 2393b29 commit 37e3d33
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Ansible Release # feel free to pick your own name

on:
push:
branches:
- main
paths:
- 'galaxy.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2

- name: building collection
run: ./build_collection.sh
shell: bash

- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Version_$(grep -oP '^version: \K.*' ./galaxy.yml)"
- name: Relase new version
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: ./releases/*.tar.gz
...
3 changes: 2 additions & 1 deletion build_collection.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

ansible-galaxy collection build

ansible-galaxy collection build --output-path ./releases
2 changes: 1 addition & 1 deletion publish_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ if [ $# -ne 1 ]; then
echo "usage: ${0} <file.tar.gz>"
exit 1
fi
ansible-galaxy collection publish ${1} -s inbound-redhat_cop
ansible-galaxy collection publish ./releases/${1} -s inbound-redhat_cop
rm -rf ${1}

0 comments on commit 37e3d33

Please sign in to comment.