Skip to content

Commit

Permalink
Refactor release workflow with makefile target (#14)
Browse files Browse the repository at this point in the history
* Refactor release workflow with makefile target
  • Loading branch information
teddyphreak authored Feb 28, 2024
1 parent d815626 commit 530de8f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
---
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
# repository or organization.
#
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
# See: https://github.com/ansible/galaxy/issues/46

name: release

on:
Expand All @@ -17,24 +11,31 @@ defaults:
working-directory: 'nephelaiio.growfs'

jobs:

release:
name: release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
- name: Check out the codebase
uses: actions/checkout@v3
with:
path: 'nephelaiio.growfs'

- name: Set up Python 3.
uses: actions/setup-python@v2
- name: set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Ansible.
run: pip3 install ansible-base
- name: Update ubuntu repositories
run: sudo apt-get update

- name: Install make
run: sudo apt-get install -y make

- name: Install dependencies
run: make install

- name: Trigger a new import on Galaxy.
run: >-
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo $GITHUB_REPOSITORY | cut -d/ -f1) $(echo $GITHUB_REPOSITORY | cut -d/ -f2)
- name: Trigger a new import on galaxy
run: make publish
env:
GALAXY_API_KEY: "${{ secrets.GALAXY_API_KEY }}"
GITHUB_REPOSITORY: "${{ github.repository }}"
4 changes: 4 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
fileignoreconfig:
- filename: .github/workflows/release.yml
ignore_detectors: [filecontent]
- filename: pyproject.toml
ignore_detectors: [filecontent]
- filename: poetry.lock
ignore_detectors: [filecontent]
- filename: tasks/lvm.yml
Expand Down
2 changes: 1 addition & 1 deletion molecule/debian/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ provisioner:
molecule_libvirt_netaddr: "{{ lookup('env', 'MOLECULE_NET', default='192.168.247.0/24') | ansible.utils.ipv4('network/prefix') }}"
molecule_libvirt_netsize: "{{ molecule_libvirt_netaddr | ansible.utils.ipaddr('prefix') }}"
molecule_libvirt_address: "{{ molecule_libvirt_netaddr | ansible.utils.nthhost(1) }}/{{ molecule_libvirt_netsize }}"
molecule_libvirt_network: "molecule"
molecule_libvirt_network: "growfs"
molecule_libvirt_path: "/var/lib/libvirt/growfs"
molecule_install_dir: "{{ lookup('env', 'MOLECULE_OUTPUT_DIR', default='/tmp/logs') }}"
molecule_kvm_keypair: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/kvm_key"
Expand Down
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ netaddr = "^0.9.0"
yamllint = "^1.32.0"
libvirt-python = "^9.8.0"
lxml = "^5.1.0"
passlib = "^1.7.4"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 530de8f

Please sign in to comment.