-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devide the release process in two parts
This will first run a workflow that performs the "git-actions", like creating the changelog, bumping the version and tagging. Secondly the tag itself will trigger a publish workflow that will build packages and docs and publish them to the corresponding places. [noissue]
- Loading branch information
Showing
4 changed files
with
174 additions
and
202 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
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 |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{% include 'header.j2' %} | ||
{% from 'macros.j2' import | ||
set_env_vars, | ||
checkout, | ||
setup_python, | ||
setup_ruby, | ||
install_httpie, | ||
display_logs, | ||
run_script, | ||
set_secrets, | ||
install_python_deps, | ||
configure_git, | ||
with context %} | ||
--- | ||
name: {{ plugin_app_label | camel }} Publish Release | ||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]" | ||
|
||
defaults: | ||
run: | ||
working-directory: "{{ plugin_name }}" | ||
|
||
jobs: | ||
build-bindings-docs: | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
# Install scripts expect TEST to be set, 'docs' is most appropriate even though we don't run tests | ||
env: | ||
TEST: docs | ||
PLUGIN_VERSION: {{ "${{ github.ref_name }}" }} | ||
|
||
steps: | ||
{{ checkout(depth=1, path=plugin_name) | indent(6) }} | ||
|
||
{{ setup_python() | indent(6) }} | ||
|
||
{%- if deploy_client_to_rubygems %} | ||
{{ setup_ruby() | indent(6) }} | ||
{%- endif %} | ||
|
||
{{ install_httpie() | indent(6) }} | ||
|
||
# Building the bindings and docs requires accessing the OpenAPI specs endpoint, so we need to | ||
# setup the Pulp instance. | ||
{{ run_script(name="Before Install", file="before_install.sh") | indent(6) }} | ||
|
||
{{ run_script(name="Install", file="install.sh") | indent(6) }} | ||
|
||
{{ run_script(name="Install Python client", file="install_python_client.sh", withenv=False) | indent(6) }} | ||
|
||
{%- if deploy_client_to_rubygems %} | ||
{{ run_script(name="Install Ruby client", file="install_ruby_client.sh", withenv=False) | indent(6) }} | ||
{%- endif %} | ||
|
||
- name: Upload python client packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-client.tar | ||
path: python-client.tar | ||
|
||
- name: Upload python client docs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-client-docs.tar | ||
path: python-client-docs.tar | ||
|
||
{%- if deploy_client_to_rubygems %} | ||
- name: Upload ruby client packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ruby-client.tar | ||
path: ruby-client.tar | ||
{%- endif %} | ||
|
||
{%- if publish_docs_to_pulpprojectdotorg and docs_test %} | ||
- name: Build docs | ||
run: | | ||
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings | ||
export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py | ||
make -C docs/ PULP_URL="{{ pulp_scheme }}://pulp" diagrams html | ||
tar -cvf docs/docs.tar docs/_build | ||
|
||
- name: Upload built docs | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: docs.tar | ||
path: docs/docs.tar | ||
{%- endif %} | ||
|
||
{{ display_logs() | indent(6) }} | ||
|
||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build-bindings-docs | ||
|
||
env: | ||
TEST: publish | ||
GITHUB_TOKEN: {{ "${{ secrets.GITHUB_TOKEN }}" }} | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: {{ plugin_name }}.tar | ||
|
||
{{ setup_python(pyversion="3.8") | indent(6) }} | ||
|
||
{{ setup_ruby() | indent(6) }} | ||
|
||
{{ configure_git() | indent(6) }} | ||
|
||
- name: Untar repository | ||
run: | | ||
tar -xf {{ plugin_name }}.tar | ||
|
||
{{ set_secrets() | indent(6) }} | ||
|
||
{{ install_python_deps("gitpython requests packaging~=21.3") | indent(6) }} | ||
|
||
{%- if publish_docs_to_pulpprojectdotorg and docs_test %} | ||
|
||
- name: Download built docs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: docs.tar | ||
|
||
- name: Download Python client docs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-client-docs.tar | ||
|
||
- name: Publish docs to pulpproject.org | ||
run: | | ||
tar -xvf docs.tar | ||
.github/workflows/scripts/publish_docs.sh tag {{ "${{ github.ref_name }}" }} | ||
{%- endif %} | ||
|
||
{%- if deploy_to_pypi %} | ||
- name: Deploy plugin to pypi | ||
run: bash .github/workflows/scripts/publish_plugin_pypi.sh {{ "${{ github.ref_name }}" }} | ||
{%- endif %} | ||
|
||
{%- if deploy_client_to_pypi %} | ||
- name: Download Python client | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-client.tar | ||
|
||
- name: Untar python client packages | ||
run: tar -xvf python-client.tar | ||
|
||
- name: Publish client to pypi | ||
run: bash .github/workflows/scripts/publish_client_pypi.sh | ||
{%- endif %} | ||
|
||
{%- if deploy_client_to_rubygems %} | ||
- name: Download Ruby client | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ruby-client.tar | ||
|
||
- name: Untar Ruby client packages | ||
run: tar -xvf ruby-client.tar | ||
|
||
- name: Publish client to rubygems | ||
run: bash .github/workflows/scripts/publish_client_gem.sh | ||
{%- endif %} | ||
|
||
- name: Create release on GitHub | ||
run: bash .github/workflows/scripts/create_release_from_tag.sh {{ "${{ github.ref_name }}" }} |
Oops, something went wrong.