Skip to content

Commit

Permalink
Update publish_ansible_collection.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kvelarde-itential authored Aug 12, 2024
1 parent 7a40fa1 commit 3cd128b
Showing 1 changed file with 48 additions and 38 deletions.
86 changes: 48 additions & 38 deletions .github/workflows/publish_ansible_collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,51 @@ jobs:
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.8
# - name: Install Ansible
# run: pip install ansible
# - name: Determine Ansible Galaxy version
# run: echo "GALAXY_VERSION=$(echo ${{ github.ref_name }} | cut -c2-)" >> $GITHUB_ENV
# - name: Update Ansible Galaxy version
# run: |
# git config user.name github-actions
# git config user.email [email protected]
# git checkout main
# echo "Updating version to ${{ env.GALAXY_VERSION }} in galaxy.yml"
# sed -i 's/\(version:\) .*/\1 ${{ env.GALAXY_VERSION }}/g' galaxy.yml
# git add galaxy.yml
# - name: Update changelog
# run: |
# python scripts/changelog.py > CHANGELOG.md
# git add CHANGELOG.md
# - name: Commit changes
# run: |
# git commit -m "Update galaxy version and changelog for release ${{ env.GALAXY_VERSION }} [skip ci]"
# git push origin HEAD:main
# - name: Update release tag
# run: |
# git pull
# git tag -f ${{ github.ref_name }}
# git push origin HEAD:main
# git push origin -f ${{ github.ref_name }}
# - name: Build Ansible collection
# run: ansible-galaxy collection build
# - name: Determine collection artifact name
# run: echo "ARTIFACT=itential-deployer-${{ env.GALAXY_VERSION }}.tar.gz" >> $GITHUB_ENV
# - name: Publish collection to Ansible Galaxy
# env:
# ANSIBLE_API_TOKEN: ${{ secrets.ANSIBLE_API_TOKEN }}
# run: ansible-galaxy collection publish ${{ env.ARTIFACT }} --token $ANSIBLE_API_TOKEN

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8

Check failure on line 21 in .github/workflows/publish_ansible_collection.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[trailing-spaces]

Trailing spaces

- name: Install Ansible
run: pip install ansible

- name: Determine Ansible Galaxy version
run: echo "GALAXY_VERSION=$(echo ${{ github.ref_name }} | cut -c2-)" >> $GITHUB_ENV

- name: Update Ansible Galaxy version
run: |
git config user.name github-actions
git config user.email [email protected]
git checkout main
echo "Updating version to ${{ env.GALAXY_VERSION }} in galaxy.yml"
sed -i 's/\(version:\) .*/\1 ${{ env.GALAXY_VERSION }}/g' galaxy.yml
git add galaxy.yml
- name: Update changelog
run: |
python scripts/changelog.py > CHANGELOG.md
git add CHANGELOG.md
- name: Commit changes
run: |
git commit -m "Update galaxy version and changelog for release ${{ env.GALAXY_VERSION }} [skip ci]"
git push origin HEAD:main
- name: Update release tag
run: |
git pull
git tag -f ${{ github.ref_name }}
git push origin HEAD:main
git push origin -f ${{ github.ref_name }}
- name: Build Ansible collection
run: ansible-galaxy collection build

- name: Determine Ansible collection archive name
run: echo "ARTIFACT=itential-deployer-${{ env.GALAXY_VERSION }}.tar.gz" >> $GITHUB_ENV

- name: Publish collection to Ansible Galaxy
env:
ANSIBLE_API_TOKEN: ${{ secrets.ANSIBLE_API_TOKEN }}
run: ansible-galaxy collection publish ${{ env.ARTIFACT }} --token $ANSIBLE_API_TOKEN

0 comments on commit 3cd128b

Please sign in to comment.