2024.3.1 #24
Workflow file for this run
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: Test & Publish PyPi release | |
on: | |
workflow_dispatch: null | |
release: | |
types: [created] | |
jobs: | |
test-pypi: | |
name: Test PyPi release | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip build | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create tag | |
# if present, remove leading `v` | |
run: | | |
echo "VERSION_TAG=$(git describe --tags | sed 's/^v//')" >> $GITHUB_ENV | |
echo ${{ env.VERSION_TAG }} | |
- name: Build source and binary | |
run: python -m build --sdist --wheel . | |
- name: Publish to test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Sleep | |
run: sleep 120 | |
- name: Test install from Test PyPI | |
run: | | |
pip install \ | |
--index-url https://test.pypi.org/simple/ \ | |
--extra-index-url https://pypi.org/simple \ | |
nebari-workflow-controller==2023.7.1 | |
release-pypi: | |
name: Publish Nebari-Workflow-Controller on PyPi | |
runs-on: ubuntu-latest | |
needs: test-pypi | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Upgrade pip | |
run: python -m pip install --upgrade pip build | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build source and binary | |
run: python -m build --sdist --wheel . | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 |