Merge pull request #301 from staticdev/dependabot/pip/dot-github/work… #365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Release | |
"on": | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Upgrade pip | |
run: | | |
pip install --constraint=.github/workflows/constraints.txt pip | |
pip --version | |
- name: Check if there is a parent commit | |
id: check-parent-commit | |
run: | | |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)" | |
- name: Detect and tag new version | |
id: check-version | |
if: steps.check-parent-commit.outputs.sha | |
uses: salsify/action-detect-and-tag-new-version@v2 | |
with: | |
tag-template: "{VERSION}" | |
version-command: | | |
cat current-version.txt | |
- name: Install Ansible | |
run: | | |
pip install --constraint=.github/workflows/constraints.txt ansible | |
- name: Trigger a new import on Galaxy. | |
# --role-name is a workaround for ongoing | |
# https://forum.ansible.com/t/ansible-galaxy-s-role-import-enhancements-and-fixes-for-the-new-year/3206/9 | |
run: >- | |
ansible-galaxy role import --role-name=python_developer --api-key ${{ secrets.GALAXY_API_KEY }} | |
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) | |
- name: Publish the release notes | |
uses: release-drafter/[email protected] | |
with: | |
publish: ${{ steps.check-version.outputs.tag != '' }} | |
tag: ${{ steps.check-version.outputs.tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |