-
Notifications
You must be signed in to change notification settings - Fork 15
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
Skip deploy
workflow when PyPI token is not defined in GitHub secrets
#147
Merged
Merged
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2782d3a
Ensure scripts fail if finding the latest tagged commit fails
Ndpnt 667a70f
Always return a result even with no reachable tags
Ndpnt 7afe300
Skip deploy job if Pypi token is not defined
Ndpnt 661329a
Update deprecated syntax
Ndpnt 695050a
Rename PyPI token GitHub secret
Ndpnt 9eb3c68
Update packaging section in README
Ndpnt 2bf4777
Add changelog entry
Ndpnt 42d4e9d
Update version
Ndpnt e751b8b
Improve wording
Ndpnt ff314a5
Remove redundant instructions
Ndpnt 69286d8
Unify bash multiline
Ndpnt f90bf28
Add comment
Ndpnt cb310dc
Fallback to lint all files if there are no tags
Ndpnt 269240f
Refactor duplication by creating a generic linting script
Ndpnt 0af37a7
Remove whitespaces
Ndpnt 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 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 |
---|---|---|
|
@@ -23,12 +23,29 @@ jobs: | |
with: | ||
python-version: 3.9.12 | ||
- id: stop-early | ||
run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi | ||
run: | | ||
if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then | ||
echo "status=success" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
check-pypi-token: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
pypi_token_present: ${{ steps.check_token.outputs.pypi_token_present }} | ||
steps: | ||
- name: Check PYPI Token | ||
Ndpnt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
id: check_token | ||
run: | | ||
if [[ -n "${{ secrets.PYPI_TOKEN }}" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
echo "pypi_token_present=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "pypi_token_present=false" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
deploy: | ||
runs-on: ubuntu-22.04 | ||
needs: [ validate, check-for-functional-changes ] | ||
if: needs.check-for-functional-changes.outputs.status == 'success' | ||
needs: [ validate, check-for-functional-changes, check-pypi-token ] | ||
if: needs.check-for-functional-changes.outputs.status == 'success' && needs.check-pypi-token.outputs.pypi_token_present == 'true' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
|
@@ -46,6 +63,6 @@ jobs: | |
path: dist | ||
key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} | ||
- name: Upload a Python package to PyPi | ||
run: twine upload dist/* --username __token__ --password ${{ secrets.PYPI_TOKEN_OPENFISCA_BOT }} | ||
run: twine upload dist/* --username __token__ --password ${{ secrets.PYPI_TOKEN }} | ||
- name: Publish a git tag | ||
run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go multiline, let's do it all the way 😉