Skip to content

Commit

Permalink
internal(CI): Added a GitHub release action to create a new tag/relea…
Browse files Browse the repository at this point in the history
…se per plugin

Removed the option to build publish/release all plugins at once
  • Loading branch information
ZachiNachshon committed May 9, 2024
1 parent 97cedb1 commit a763300
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- 'provisioner_examples_plugin'
- 'provisioner_installers_plugin'
- 'provisioner_single_board_plugin'
- 'all'
required: true

env:
Expand All @@ -20,7 +19,7 @@ env:
POETRY_VERSION: "1.4.1"

jobs:
publis_to_pypi:
publish_to_pypi:
name: Publish provisioner plugins to PyPi
runs-on: ubuntu-latest
strategy:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create a GitHub plugin release

on:
workflow_dispatch:
inputs:
plugin_to_publish:
type: choice
description: 'Select plugin to add as GitHub release'
options:
- 'provisioner_examples_plugin'
- 'provisioner_installers_plugin'
- 'provisioner_single_board_plugin'
required: true

env:
PYPI_API_TOKEN: ${{ secrets.PROVISIONER_PYPI_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTION_PLUGIN_TO_PUBLISH: ${{ github.event.inputs.plugin_to_publish }}
POETRY_VERSION: "1.4.1"

jobs:
publish_to_pypi:
name: Publish provisioner plugins to PyPi
runs-on: ubuntu-latest
strategy:
matrix:
python: [ '3.10' ]

steps:
- name: Checkout ZachiNachshon/provisioner
uses: actions/checkout@v3
with:
repository: 'ZachiNachshon/provisioner'
token: ${{ secrets.PROVISIONER_REPO_ACCESS_TOKEN }}

- name: Checkout ZachiNachshon/provisioner-plugins
uses: actions/checkout@v3
with:
path: './plugins'

- name: Setup Environment
uses: ./.github/actions/setup
env:
PYTHON_VERSION: ${{ matrix.python }}
POETRY_VERSION: ${{ env.POETRY_VERSION }}

# Tests should be run when the PR created after publish to PyPi was merged

- name: Create a GitHub release
uses: ./.github/actions/release
with:
publishable: ${{ github.event.inputs.plugin_to_publish }}
is_plugin: true
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions provisioner_examples_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ pip-uninstall: ## Uninstall a source distribution from local pip

.PHONY: pip-publish-github
pip-publish-github: ## Publish a pip package tarball as a GitHub release
@${POETRY_PIP_RELEASER} publish \
@${POETRY_PIP_RELEASER} publish -y \
--multi-project \
--build-type sdist \
--build-type wheel \
--plugin \
--release-type github \
--release-tag $(shell cat ../../provisioner/provisioner/resources/version.txt) -y
--release-tag-prefix examples_plugin

.PHONY: pip-publish-pypi
pip-publish-pypi: ## Publish a pip package tarball as a PyPi release
Expand Down
7 changes: 4 additions & 3 deletions provisioner_installers_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ pip-uninstall: ## Uninstall a source distribution from local pip

.PHONY: pip-publish-github
pip-publish-github: ## Publish a pip package tarball as a GitHub release
@${POETRY_PIP_RELEASER} publish \
--build-type sdist \
@${POETRY_PIP_RELEASER} publish -y \
--multi-project \
--build-type wheel \
--plugin \
--release-type github \
--release-tag $(shell cat ../../provisioner/provisioner/resources/version.txt) -y
--release-tag-prefix installers_plugin

.PHONY: pip-publish-pypi
pip-publish-pypi: ## Publish a pip package tarball as a PyPi release
Expand Down
7 changes: 4 additions & 3 deletions provisioner_single_board_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ pip-uninstall: ## Uninstall a source distribution from local pip

.PHONY: pip-publish-github
pip-publish-github: ## Publish a pip package tarball as a GitHub release
@${POETRY_PIP_RELEASER} publish \
--build-type sdist \
@${POETRY_PIP_RELEASER} publish -y \
--multi-project \
--build-type wheel \
--plugin \
--release-type github \
--release-tag $(shell cat ../../provisioner/provisioner/resources/version.txt) -y
--release-tag-prefix single_board_plugin

.PHONY: pip-publish-pypi
pip-publish-pypi: ## Publish a pip package tarball as a PyPi release
Expand Down

0 comments on commit a763300

Please sign in to comment.