Merge pull request #768 from ccamacho/okd #552
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
--- | |
# This job will execute a release: | |
# Ansible galaxy new release | |
# GitHub release with tag | |
# Mirror to GitLab | |
# Documents release | |
name: release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
if: github.repository_owner == 'Kubeinit' | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt update -y | |
sudo apt install jq -y | |
sudo apt-get remove ansible -y | |
sudo locale-gen en_US.UTF-8 | |
sudo dpkg-reconfigure locales | |
sudo apt install build-essential findutils -y | |
sudo apt-get --purge autoremove python3-pip | |
sudo apt install python3-pip | |
sudo python3 -m pip uninstall ansible ansible-base ansible-core -y | |
sudo python3 -m pip install -r test-requirements.txt | |
sudo python3 -m pip install --upgrade pip | |
sudo python3 -m pip install --upgrade virtualenv | |
sudo python3 -m pip install --upgrade setuptools | |
sudo python3 -m pip install tox shyaml | |
sudo python3 -m pip install twine | |
- name: Mirror to GitLab | |
run: | | |
git clone https://github.com/Kubeinit/kubeinit.git kubeinit_mirror | |
cd kubeinit_mirror | |
git branch -r | grep -v -- ' -> ' | while read remote; do git branch --track "${remote#origin/}" "$remote" 2>&1 | grep -v ' already exists'; done || true | |
git fetch --all | |
git pull --all | |
sed -i 's/https:\/\/github\.com\/Kubeinit\/kubeinit\.git/https:\/\/github-access:${{ secrets.GITLAB_TOKEN }}@gitlab\.com\/kubeinit\/kubeinit.git/g' .git/config | |
git push --force --all origin | |
- name: Create collection build and publish | |
run: | | |
chmod +x ./ci/release.sh | |
sudo GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
QUAY_USER=${{ secrets.QUAY_USER }} \ | |
QUAY_KEY=${{ secrets.QUAY_KEY }} \ | |
GALAXY_KEY=${{ secrets.GALAXY_KEY }} \ | |
./ci/release.sh | |
- name: Create pypi package and publish | |
run: | | |
./ci/pypi_publish.sh -k ${{ secrets.PYPI_TOKEN }} | |
- name: Install latest Kubeinit agent version build locally if we published a new version | |
run: | | |
cd ./agent | |
if [ -d "./dist" ] | |
then | |
python3 -m pip install --force dist/* | |
kubeinit -v | |
fi |