-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update publish_ansible_collection.yml
- Loading branch information
1 parent
7a40fa1
commit 3cd128b
Showing
1 changed file
with
48 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
- 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 |