Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Apr 17, 2024
1 parent 56e97e1 commit de1bc91
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ on:

jobs:
test:
name: 'Test'
name: 'Molecule'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: 'debian-10'
- distro: 'debian-11'
- distro: 'rockylinux-8'
- distro: 'ubuntu-20.04'
- distro: 'rockylinux-9'
- distro: 'ubuntu-22.04'

steps:
- name: 'Checkout the codebase'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Test role'
- name: 'Testing an Ansible role with Molecule'
uses: gofrolist/molecule-action@v2
with:
molecule_command: test
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@ on:

jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
steps:
- name: 'Checkout the codebase'
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: 'Install ansible-core package.'
- name: 'Install ansible-core package'
run: pip3 install ansible-core

- name: 'Get an Ansible role name'
id: get_role_name
run: echo "ROLE_NAME=$(yq '.galaxy_info.role_name' meta/main.yml)" >> $GITHUB_OUTPUT

- name: 'Publish the role to the Ansible Galaxy'
run: >-
ansible-galaxy role import \
--api-key ${{ secrets.GALAXY_API_KEY }} \
--role-name microsoft_repository \
--role-name ${{ steps.get_role_name.outputs.ROLE_NAME }} \
$(echo $GITHUB_REPOSITORY | cut -d/ -f1) $(echo $GITHUB_REPOSITORY | cut -d/ -f2)
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
---
name: 'Release'
on:
push:
workflow_run:
workflows: ['Molecule']
types: [completed]
branches:
- main

jobs:
release:
name: 'Release'
runs-on: ubuntu-latest
# Skip running release workflow on forks
if: github.repository_owner == 'antmelekhin'
if: ${{ github.repository_owner == 'antmelekhin' && github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Checkout the codebase'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: 'Semantic Release'
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19.0.5
semantic_version: 23.0.8
extra_plugins: |
@semantic-release/git@10.0.1
@semantic-release/changelog@6.0.3
conventional-changelog-conventionalcommits@5.0.0
conventional-changelog-conventionalcommits@7.0.2
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 comments on commit de1bc91

Please sign in to comment.