Stage Release #23
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: Stage Release | |
env: | |
LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Ascender version.' | |
required: true | |
default: '' | |
confirm: | |
description: 'Are you sure? Set this to yes.' | |
required: true | |
default: 'no' | |
jobs: | |
stage: | |
if: endsWith(github.repository, '/ascender') | |
runs-on: ubuntu-latest | |
timeout-minutes: 90 | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- name: Verify inputs | |
run: | | |
set -e | |
if [[ ${{ github.event.inputs.confirm }} != "yes" ]]; then | |
>&2 echo "Confirm must be 'yes'" | |
exit 1 | |
fi | |
if [[ ${{ github.event.inputs.version }} == "" ]]; then | |
>&2 echo "Set version to continue." | |
exit 1 | |
fi | |
exit 0 | |
- name: Checkout ascender | |
uses: actions/checkout@v3 | |
with: | |
path: ascender | |
- 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@v4 | |
with: | |
python-version: ${{ env.py_version }} | |
- name: Install playbook dependencies | |
run: | | |
python3 -m pip install docker==6.1.3 | |
- name: Build and stage Ascender | |
working-directory: ascender | |
run: | | |
ansible-playbook -v tools/ansible/build.yml \ | |
-e registry=ghcr.io \ | |
-e registry_username=${{ github.actor }} \ | |
-e registry_password=${{ secrets.GITHUB_TOKEN }} \ | |
-e awx_image=${{ github.repository }} \ | |
-e awx_version=${{ github.event.inputs.version }} \ | |
-e ansible_python_interpreter=$(which python3) \ | |
-e push=yes \ | |
-e awx_official=no | |
- name: Log in to GHCR | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: tag awx-ee:latest with version input | |
run: | | |
docker buildx imagetools create \ | |
quay.io/ansible/awx-ee:latest \ | |
--tag ghcr.io/${{ github.repository_owner }}/awx-ee:${{ github.event.inputs.version }} | |
- name: Create draft release for Ascender | |
working-directory: ascender | |
run: | | |
ansible-playbook -v tools/ansible/stage.yml \ | |
-e repo=${{ github.repository }} \ | |
-e awx_image=ghcr.io/${{ github.repository }} \ | |
-e version=${{ github.event.inputs.version }} \ | |
-e github_token=${{ secrets.GITHUB_TOKEN }} | |