-
Notifications
You must be signed in to change notification settings - Fork 18
Conda and pypi publish workflow #4
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
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5609372
conda and pypi publish workflow
cvanelteren c2a9655
separated workflows
cvanelteren 35204ef
renamed yml to ensure consistency
cvanelteren 9c75035
separate build and test
cvanelteren 4cf2c94
# This is a combination of 2 commits.
cvanelteren defb219
separate build and test
cvanelteren fa1f2fc
removed conda recipe
cvanelteren 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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Build and Test | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: mamba-org/[email protected] | ||
| with: | ||
| environment-file: ./environment-dev.yml | ||
| init-shell: bash | ||
| create-args: --verbose | ||
| cache-environment: true | ||
| cache-downloads: false | ||
|
|
||
| - name: Test Ultraplot | ||
| shell: bash -el {0} | ||
| run: | | ||
| micromamba activate ultraplot-dev | ||
| pip install . | ||
|
|
||
| - name: "Build docs" | ||
| shell: bash -el {0} | ||
| run: | | ||
| micromamba activate ultraplot-dev | ||
| cd docs | ||
| make html | ||
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,27 @@ | ||
| name: Build and Test | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: mamba-org/[email protected] | ||
| with: | ||
| environment-file: ./environment-dev.yml | ||
| init-shell: bash | ||
| create-args: --verbose | ||
| cache-environment: true | ||
| cache-downloads: false | ||
|
|
||
| - name: Test Ultraplot | ||
| shell: bash -el {0} | ||
| run: | | ||
| micromamba activate ultraplot-dev | ||
| pip install . | ||
| python -m pytest |
70 changes: 3 additions & 67 deletions
70
.github/workflows/ultraplot.yml → .github/workflows/publish-conda.yml
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,74 +1,10 @@ | ||
| name: Build and Test | ||
| name: Publish to Conda | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: ["v*"] | ||
| pull_request: | ||
| branches: [main] | ||
| release: | ||
| types: [published] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: mamba-org/[email protected] | ||
| with: | ||
| environment-file: ./environment-dev.yml | ||
| init-shell: >- | ||
| bash | ||
| create-args: >- | ||
| --verbose | ||
| cache-environment: true | ||
| cache-downloads: false | ||
|
|
||
| - name: Test Ultraplot | ||
| shell: bash -el {0} | ||
| run: | | ||
| micromamba activate ultraplot-dev | ||
| pip install . | ||
| python -m pytest | ||
|
|
||
| - name: "Build docs" | ||
| shell: bash -el {0} | ||
| run: | | ||
| micromamba activate ultraplot-dev | ||
| cd docs | ||
| make html | ||
|
|
||
| publish-test: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| # Run on every push to main/v* branches and pull requests | ||
| if: github.event_name == 'push' || github.event_name == 'pull_request' | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Install build | ||
| run: python -m pip install build | ||
|
|
||
| - name: Build package | ||
| run: python -m build | ||
|
|
||
| - name: Publish to TestPyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ | ||
|
|
||
| publish: | ||
| jobs: | ||
| publish-conda: | ||
| needs: [build, publish-test] | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v') | ||
|
|
||
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,46 @@ | ||
| name: Publish to PyPI | ||
| on: | ||
| release: | ||
| types: [published] | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| jobs: | ||
| publish-pypi-test: | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
| - name: Build package | ||
| run: | | ||
| python -m pip install build | ||
| python -m build | ||
| - name: Publish to TestPyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ | ||
|
|
||
| publish-prod: | ||
| needs: publish-test | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'release' | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
| - name: Build package | ||
| run: | | ||
| python -m pip install build | ||
| python -m build | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
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.