mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 01:38:50 -03:30
Publish to galaxy and pypi in promote workflow
This commit is contained in:
47
.github/workflows/promote.yml
vendored
47
.github/workflows/promote.yml
vendored
@@ -8,6 +8,53 @@ jobs:
|
|||||||
promote:
|
promote:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout awx
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get python version from Makefile
|
||||||
|
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install python ${{ env.py_version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.py_version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python${{ env.py_version }} -m pip install wheel twine
|
||||||
|
|
||||||
|
- name: Set official collection namespace
|
||||||
|
run: echo collection_namespace=awx >> $GITHUB_ENV
|
||||||
|
if: ${{ github.repository_owner == 'ansible' }}
|
||||||
|
|
||||||
|
- name: Set unofficial collection namespace
|
||||||
|
run: echo collection_namespace=${{ github.repository_owner }} >> $GITHUB_ENV
|
||||||
|
if: ${{ github.repository_owner != 'ansible' }}
|
||||||
|
|
||||||
|
- name: Build collection and publish to galaxy
|
||||||
|
run: |
|
||||||
|
COLLECTION_NAMESPACE=${{ env.collection_namespace }} make build_collection
|
||||||
|
ansible-galaxy collection publish \
|
||||||
|
--token=${{ secrets.GALAXY_TOKEN }} \
|
||||||
|
awx_collection_build/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz
|
||||||
|
|
||||||
|
- name: Set official pypi info
|
||||||
|
run: echo pypi_repo=pypi >> $GITHUB_ENV
|
||||||
|
if: ${{ github.repository_owner == 'ansible' }}
|
||||||
|
|
||||||
|
- name: Set unofficial pypi info
|
||||||
|
run: echo pypi_repo=testpypi >> $GITHUB_ENV
|
||||||
|
if: ${{ github.repository_owner != 'ansible' }}
|
||||||
|
|
||||||
|
- name: Build awxkit and upload to pypi
|
||||||
|
run: |
|
||||||
|
cd awxkit && python3 setup.py bdist_wheel
|
||||||
|
twine upload \
|
||||||
|
-r ${{ env.pypi_repo }} \
|
||||||
|
-u ${{ secrets.PYPI_USERNAME }} \
|
||||||
|
-p ${{ secrets.PYPI_PASSWORD }} \
|
||||||
|
dist/*
|
||||||
|
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
run: |
|
run: |
|
||||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|||||||
7
Makefile
7
Makefile
@@ -305,7 +305,7 @@ symlink_collection:
|
|||||||
mkdir -p ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE) # in case it does not exist
|
mkdir -p ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE) # in case it does not exist
|
||||||
ln -s $(shell pwd)/awx_collection $(COLLECTION_INSTALL)
|
ln -s $(shell pwd)/awx_collection $(COLLECTION_INSTALL)
|
||||||
|
|
||||||
build_collection:
|
awx_collection_build: $(shell find awx_collection -type f)
|
||||||
ansible-playbook -i localhost, awx_collection/tools/template_galaxy.yml \
|
ansible-playbook -i localhost, awx_collection/tools/template_galaxy.yml \
|
||||||
-e collection_package=$(COLLECTION_PACKAGE) \
|
-e collection_package=$(COLLECTION_PACKAGE) \
|
||||||
-e collection_namespace=$(COLLECTION_NAMESPACE) \
|
-e collection_namespace=$(COLLECTION_NAMESPACE) \
|
||||||
@@ -313,6 +313,8 @@ build_collection:
|
|||||||
-e '{"awx_template_version":false}'
|
-e '{"awx_template_version":false}'
|
||||||
ansible-galaxy collection build awx_collection_build --force --output-path=awx_collection_build
|
ansible-galaxy collection build awx_collection_build --force --output-path=awx_collection_build
|
||||||
|
|
||||||
|
build_collection: awx_collection_build
|
||||||
|
|
||||||
install_collection: build_collection
|
install_collection: build_collection
|
||||||
rm -rf $(COLLECTION_INSTALL)
|
rm -rf $(COLLECTION_INSTALL)
|
||||||
ansible-galaxy collection install awx_collection_build/$(COLLECTION_NAMESPACE)-$(COLLECTION_PACKAGE)-$(COLLECTION_VERSION).tar.gz
|
ansible-galaxy collection install awx_collection_build/$(COLLECTION_NAMESPACE)-$(COLLECTION_PACKAGE)-$(COLLECTION_VERSION).tar.gz
|
||||||
@@ -567,3 +569,6 @@ messages:
|
|||||||
. $(VENV_BASE)/awx/bin/activate; \
|
. $(VENV_BASE)/awx/bin/activate; \
|
||||||
fi; \
|
fi; \
|
||||||
$(PYTHON) manage.py makemessages -l $(LANG) --keep-pot
|
$(PYTHON) manage.py makemessages -l $(LANG) --keep-pot
|
||||||
|
|
||||||
|
print-%:
|
||||||
|
@echo $($*)
|
||||||
|
|||||||
Reference in New Issue
Block a user