-
Notifications
You must be signed in to change notification settings - Fork 1
Release workflow updated #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
abbc743
Modified versioning and publishing of new releases to Pypi (#41)
esparig f8b2163
Remove version.py and update pyproject.toml to define packages for se…
esparig 5d09625
Merge pull request #42 from grycap/devops/fix-workflow
esparig a986862
Fix dependencies problem and update tests (#44)
esparig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,35 +1,76 @@ | ||
| name: Release workflow - Build and Publish Package | ||
| # This workflow will upload a Python Package to PyPI when a release is created | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
|
||
| name: Upload Python Package | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'version.py' # Only run when the version is bumped | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-and-publish: | ||
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| release-build: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.get_version.outputs.version }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # Fetch sufficient history for setuptools-scm to find tags | ||
| # Using 50 commits should cover most scenarios while being faster than full history | ||
| fetch-depth: 50 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install dependencies | ||
| - name: Get version from setuptools-scm | ||
| id: get_version | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install setuptools wheel twine | ||
| python -m pip install setuptools-scm | ||
| version=$(python -m setuptools_scm) | ||
| echo "version=$version" >> $GITHUB_OUTPUT | ||
| echo "Package version: $version" | ||
|
|
||
| - name: Build package | ||
| - name: Build release distributions | ||
| run: | | ||
| python setup.py sdist bdist_wheel | ||
| python -m pip install build | ||
| python -m build | ||
|
|
||
| - name: Upload distributions | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-dists | ||
| path: dist/ | ||
|
|
||
| - name: Publish package to PyPI | ||
| pypi-publish: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - release-build | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
|
|
||
| # Dedicated environments with protections for publishing are strongly recommended. | ||
| # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules | ||
| environment: | ||
| name: pypi | ||
| # PyPI project URL with the exact version (e.g., 1.3.3 or 1.3.3b3) | ||
| url: https://pypi.org/project/oscar-python/${{ needs.release-build.outputs.version }}/ | ||
|
|
||
| steps: | ||
| - name: Retrieve release distributions | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: release-dists | ||
| path: dist/ | ||
|
|
||
| - name: Publish release distributions to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: dist/ |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=64", "setuptools-scm>=8"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "oscar-python" | ||
| dynamic = ["version"] | ||
| description = "Python client for OSCAR clusters" | ||
| readme = "README.md" | ||
| requires-python = ">=3.8" | ||
| license = {text = "Apache-2.0"} | ||
| authors = [{name = "GRyCAP - I3M - UPV"}] | ||
| keywords = ["oscar", "faas", "serverless"] | ||
|
|
||
| dependencies = [ | ||
| "requests", | ||
| "webdavclient3>=3.14.6", | ||
| "boto3", | ||
| "pyyaml", | ||
| "aiohttp", | ||
| "liboidcagent", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| dev = [ | ||
| "pytest", | ||
| "pytest-cov", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/grycap/oscar-python" | ||
| Repository = "https://github.com/grycap/oscar-python" | ||
|
|
||
| [tool.setuptools] | ||
| packages = ["oscar_python"] | ||
|
|
||
| [tool.setuptools_scm] | ||
| # Automatically get version from git tags | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -12,38 +12,10 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from setuptools import setup, find_namespace_packages | ||
| """Minimal setup.py for backward compatibility. | ||
| All configuration is now in pyproject.toml. | ||
| """ | ||
|
|
||
| # Load readme | ||
| with open('README.md', mode='r', encoding='utf-8') as f: | ||
| readme = f.read() | ||
| from setuptools import setup | ||
|
|
||
| # Load version | ||
| with open('version.py', mode='r', encoding='utf-8') as f: | ||
| exec(f.read()) | ||
|
|
||
|
|
||
| setup(name='oscar_python', | ||
| version=__version__, | ||
| description='OSCAR API for python', | ||
| long_description=readme, | ||
| long_description_content_type='text/markdown', | ||
| url='https://github.com/grycap/oscar_python', | ||
| author='GRyCAP - Universitat Politecnica de Valencia', | ||
| author_email='[email protected]', | ||
| license='Apache 2.0', | ||
| packages=find_namespace_packages(), | ||
| install_requires=[ | ||
| 'webdavclient3 == 3.14.6', | ||
| 'requests', | ||
| 'boto3', | ||
| 'setuptools >= 40.8.0', | ||
| 'pyyaml', | ||
| 'aiohttp', | ||
| 'liboidcagent', | ||
| ], | ||
| classifiers=[ | ||
| 'Programming Language :: Python :: 3', | ||
| 'License :: OSI Approved :: Apache Software License' | ||
| ], | ||
| zip_safe=False) | ||
| setup() | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.