-
Notifications
You must be signed in to change notification settings - Fork 13
setup better python package builds for iriscasttools #265
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
Open
anish-mudaraddi
wants to merge
1
commit into
stfc:master
Choose a base branch
from
anish-mudaraddi:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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,91 @@ | ||
| name: IRISCAST Bump, Build and Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump-type: | ||
| description: 'Bump type' | ||
| required: true | ||
| default: 'patch' | ||
| type: choice | ||
| options: | ||
| - major | ||
| - minor | ||
| - patch | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: "Setup Github Token" | ||
| uses: actions/create-github-app-token@v2 | ||
| id: app-token | ||
| with: | ||
| app-id: ${{ vars.APP_ID }} | ||
| private-key: ${{ secrets.PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Setting up git config | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: "${{ steps.app-token.outputs.token }}" | ||
| run: | | ||
| git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | ||
| git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)" | ||
| git config -l | ||
|
|
||
| - name: Install bump-my-version | ||
| shell: bash | ||
| run: pip install "bump-my-version" | ||
|
|
||
| - name: Pass Inputs to Shell | ||
| id: bump | ||
| shell: bash | ||
| run: | | ||
| cd iriscasttools/ | ||
| echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT | ||
|
|
||
| bump-my-version bump ${{ inputs.bump-type }} | ||
| ([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT | ||
| echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Push changes to GitHub | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| github_token: "${{ steps.app-token.outputs.token }}" | ||
| branch: master | ||
| force: true | ||
|
|
||
| - name: Check | ||
| if: steps.bump.outputs.bumped == 'true' | ||
| run: | | ||
| echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!" | ||
|
|
||
| - name: Build package | ||
| if: steps.bump.outputs.bumped == 'true' | ||
| run: | | ||
| cd iriscasttools/ | ||
| pip install build | ||
| python -m build | ||
|
|
||
| - name: Create GitHub Release | ||
| if: steps.bump.outputs.bumped == 'true' | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: iriscasttools-v${{ steps.bump.outputs.current-version }} | ||
| name: iriscasttools-v${{ steps.bump.outputs.current-version }} | ||
| files: iriscasttools/dist/* | ||
| token: "${{ steps.app-token.outputs.token }}" | ||
|
|
||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: IRISCAST Unittest | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - "iriscasttools/**" | ||
| - ".github/workflows/iriscast_unittest.yaml" | ||
| pull_request: | ||
| paths: | ||
| - "iriscasttools/**" | ||
| - ".github/workflows/iriscast_unittest.yaml" | ||
|
|
||
| jobs: | ||
| test_and_lint: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.x", "3.10"] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Navigate to Folder | ||
| run: cd ./iriscasttools | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} |
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.
Are there steps missing from this workflow? I cannot see any tests being run.