-
Notifications
You must be signed in to change notification settings - Fork 3
skpkg: setup CI after migrating tests, src, requirements, and .github folder #12
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 all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
44f7f5d
skpkg: migrate src folder
zmx27 5f697c0
skpkg: migrate tests folder
zmx27 24338ce
skpkg: list dependencies in requirements folder
zmx27 6de173e
skpkg: add CI
zmx27 7f2205d
skpkg: add pyproject.toml
zmx27 14adc8d
skpkg: add the rest of the github files
zmx27 36f9ec3
chore: change pdfgetx to srxconfutils in the .github workflow files
zmx27 9691ebc
chore: fix copyright dates and delete dpx
zmx27 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,16 @@ | ||
| --- | ||
| name: Bug Report or Feature Request | ||
| about: Report a bug or suggest a new feature! | ||
| title: "" | ||
| labels: "" | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ### Problem | ||
|
|
||
| <!-- | ||
| For a bug report, please copy and paste any error messages from the application or command-line here. | ||
| For a feature request, please state how the new functionality could benefit the community. | ||
| --> | ||
|
|
||
| ### Proposed solution |
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: Release | ||
| about: Checklist and communication channel for PyPI and GitHub release | ||
| title: "Ready for <version-number> PyPI/GitHub release" | ||
| labels: "release" | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ### PyPI/GitHub rc-release preparation checklist: | ||
|
|
||
| - [ ] All PRs/issues attached to the release are merged. | ||
| - [ ] All the badges on the README are passing. | ||
| - [ ] License information is verified as correct. If you are unsure, please comment below. | ||
| - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are | ||
| missing), tutorials, and other human-written text is up-to-date with any changes in the code. | ||
| - [ ] Installation instructions in the README, documentation, and the website are updated. | ||
| - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. | ||
| - [ ] Grammar and writing quality are checked (no typos). | ||
| - [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. | ||
|
|
||
| Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: | ||
|
|
||
| ### PyPI/GitHub full-release preparation checklist: | ||
|
|
||
| - [ ] Create a new conda environment and install the rc from PyPI (`pip install <package-name>==??`) | ||
| - [ ] License information on PyPI is correct. | ||
| - [ ] Docs are deployed successfully to `https://<github-username-or-orgname>/<package-name>`. | ||
| - [ ] Successfully run all tests, tutorial examples or do functional testing. | ||
|
|
||
| Please let the maintainer know that all checks are done and the package is ready for full release. | ||
|
|
||
| ### conda-forge release preparation checklist: | ||
|
|
||
| <!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.--> | ||
|
|
||
| - [ ] Ensure that the full release has appeared on PyPI successfully. | ||
| - [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. | ||
| - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. | ||
| - [ ] Tag the maintainer for conda-forge release. | ||
|
|
||
| ### Post-release checklist | ||
|
|
||
| <!-- Before closing this issue, please complete the following: --> | ||
|
|
||
| - [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. | ||
| - [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. |
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,15 @@ | ||
| ### What problem does this PR address? | ||
|
|
||
| <!-- Provide a brief overview and link to the issue. Attach outputs, including screenshots (before/after), if helpful for the reviewer. --> | ||
|
|
||
| ### What should the reviewer(s) do? | ||
|
|
||
| <!-- Merge the code, provide feedback, initiate a discussion, etc. --> | ||
|
|
||
| <!-- | ||
| Use the following checklist items when applicable (select only what applies): | ||
| - [ ] This PR introduces a public-facing change (e.g., figures, CLI input/output, API). | ||
| - [ ] Documentation (e.g., tutorials, examples, README) has been updated. | ||
| - [ ] A tracking issue or plan to update documentation exists. | ||
| - [ ] This PR affects internal functionality only (no user-facing change). | ||
| --> |
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,163 @@ | ||
| name: Release on GitHub | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| PAT_TOKEN: | ||
| description: "GitHub Personal Access Token" | ||
| required: true | ||
|
|
||
| env: | ||
| TAG: ${{ github.ref_name }} | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash {0} | ||
|
|
||
| jobs: | ||
| prepare-release: | ||
| if: ${{ ! contains(github.ref, 'rc') }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| fetch-depth: 0 | ||
| ref: main | ||
|
|
||
| - name: Update CHANGELOG | ||
| run: | | ||
| wget https://raw.githubusercontent.com/scikit-package/release-scripts/v0/.github/workflows/update-changelog.py | ||
| python update-changelog.py "$TAG" | ||
| rm update-changelog.py | ||
|
|
||
| - name: Commit updated CHANGELOG.rst | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add . | ||
| if ! git diff --cached --quiet; then | ||
| git commit -m "update changelog for $TAG" | ||
| git push origin main | ||
| else | ||
| echo "No CHANGELOG.rst changes" | ||
| fi | ||
|
|
||
| - name: New tag | ||
| run: | | ||
| git fetch --tags | ||
| git tag -d "$TAG" 2>/dev/null || true | ||
| git push origin ":$TAG" 2>/dev/null || true | ||
| git tag "$TAG" | ||
| git push origin "$TAG" | ||
|
|
||
| - name: Get CHANGELOG.txt | ||
| run: | | ||
| wget https://raw.githubusercontent.com/scikit-package/release-scripts/v0/.github/workflows/get-latest-changelog.py | ||
| python get-latest-changelog.py "$TAG" | ||
| rm get-latest-changelog.py | ||
|
|
||
| - name: Upload changelog.txt | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: changelog | ||
| path: CHANGELOG.txt | ||
|
|
||
| release: | ||
| needs: [prepare-release] | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| REPO_FULL: ${{ github.repository }} | ||
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
| steps: | ||
| - name: Check prepare release | ||
| run: | | ||
| if [[ ${{ needs.prepare-release.result }} != 'success' && "$TAG" != *rc* ]]; then | ||
| echo "::error::Skipping release job because prepare-release failed" | ||
| exit 78 | ||
| fi | ||
| echo "Continuing with release job" | ||
|
|
||
| - name: Download built wheels | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist/ | ||
|
|
||
| - name: Download changelog | ||
| if: ${{ needs.prepare-release.result == 'success' }} | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: changelog | ||
| path: . | ||
|
|
||
| - name: Download instructions | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: instructions | ||
| path: . | ||
|
|
||
| - name: Zip wheels and instructions into dist/srxconfutils-$TAG-wheels.zip | ||
| run: | | ||
| mkdir -p dist | ||
| find dist -type f -name '*.whl' | zip -j dist/srxconfutils-"$TAG"-wheels.zip -@ | ||
| zip -j dist/srxconfutils-"$TAG"-wheels.zip INSTRUCTIONS.txt | ||
|
|
||
| - name: Prepare release metadata | ||
| id: meta | ||
| run: | | ||
| if [[ "$TAG" == *rc* ]]; then | ||
| PRERELEASE=true | ||
| TITLE="Pre-release $TAG" | ||
| BODY_RAW="Changelog: https://github.com/$REPO_FULL/commits/$TAG" | ||
| else | ||
| PRERELEASE=false | ||
| TITLE="Release $TAG" | ||
| BODY_RAW=$(<CHANGELOG.txt) | ||
| fi | ||
|
|
||
| jq -n \ | ||
| --arg tag "$TAG" \ | ||
| --arg name "$TITLE" \ | ||
| --arg body "$BODY_RAW" \ | ||
| --argjson prerelease "$PRERELEASE" \ | ||
| '{ tag_name: $tag, | ||
| name: $name, | ||
| body: $body, | ||
| prerelease: $prerelease | ||
| }' > payload.json | ||
|
|
||
| echo "Release metadata:" | ||
| cat payload.json | ||
|
|
||
| - name: Create GitHub Release | ||
| id: create_release | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| HTTP_STATUS=$( | ||
| curl --silent --output resp.json --write-out "%{http_code}" \ | ||
| -X POST "https://api.github.com/repos/$REPO_FULL/releases" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer $PAT_TOKEN" \ | ||
| --data @payload.json | ||
| ) | ||
| if [[ "$HTTP_STATUS" -ne 201 ]]; then | ||
| echo "::error::Failed to create release (status $HTTP_STATUS)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| UPLOAD_URL=$(jq -r .upload_url resp.json | sed 's/{.*}//') | ||
| echo "upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Upload srxconfutils-$TAG-wheels.zip | ||
| if: steps.create_release.outputs.upload_url != '' | ||
| run: | | ||
| FILE=dist/srxconfutils-$TAG-wheels.zip | ||
| echo "Uploading asset: $FILE" | ||
| curl --silent --fail --data-binary @"$FILE" \ | ||
| -H "Content-Type: application/zip" \ | ||
| -H "Authorization: Bearer $PAT_TOKEN" \ | ||
| "${{ steps.create_release.outputs.upload_url }}?name=$(basename "$FILE")" | ||
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,12 @@ | ||
| name: Check for News | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| check-news-item: | ||
| uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0 | ||
| with: | ||
| project: diffpy.srxconfutils |
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,19 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - prereleased | ||
| - published | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| matrix-coverage: | ||
| uses: scikit-package/release-scripts/.github/workflows/_matrix-no-codecov-on-merge-to-main.yml@v0 | ||
| with: | ||
| project: diffpy.srxconfutils | ||
| c_extension: false | ||
| headless: false |
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.
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.
Since this is a private package that we are not releasing on PyPI/CF, I just copied the build-wheel file from
pdfgetxbut with some minor modifications. Let me know if you want any of this changed.