-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be5b5d
commit 0a23425
Showing
7 changed files
with
174 additions
and
69 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,41 @@ | ||
name: Deploy Salt Extension Python Package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
test: | ||
type: boolean | ||
required: false | ||
default: true | ||
version: | ||
type: string | ||
required: true | ||
secrets: | ||
PYPI_API_TOKEN: | ||
required: false | ||
TEST_PYPI_API_TOKEN: | ||
required: false | ||
|
||
jobs: | ||
build: | ||
name: Publish Python Package to ${{ fromJSON('["PyPI", "Test PyPI"]')[inputs.test] }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Python Package Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: salt-extension-${{ inputs.version }}-packages | ||
path: dist | ||
|
||
- name: Publish distribution to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: ${{ inputs.test }} | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: ${{ !inputs.test }} | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
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,50 @@ | ||
name: Salt Extension Python Package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Build Python Packages (wheel and sdist) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Echo Version | ||
run: echo "${{ inputs.version }}" | ||
|
||
- name: Setup Version | ||
run: echo "${{ inputs.version }}" > version.txt | ||
|
||
- name: Build Wheel | ||
run: python -m build --outdir dist/ | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: salt-extension-${{ inputs.version }}-packages | ||
path: dist/* | ||
retention-days: 5 | ||
|
||
- name: Set Exit Status | ||
if: always() | ||
run: | | ||
mkdir exitstatus | ||
echo "${{ job.status }}" > exitstatus/${{ github.job }} |
File renamed without changes.
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