Skip to content

Commit 5c20add

Browse files
setup better python package builds for iriscasttools
update to latest python version test
1 parent 3de1d13 commit 5c20add

File tree

15 files changed

+956
-777
lines changed

15 files changed

+956
-777
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: IRISCAST Bump, Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump-type:
7+
description: 'Bump type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- major
13+
- minor
14+
- patch
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: "Setup Github Token"
25+
uses: actions/create-github-app-token@v2
26+
id: app-token
27+
with:
28+
app-id: ${{ vars.APP_ID }}
29+
private-key: ${{ secrets.PRIVATE_KEY }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.11"
38+
39+
- name: Setting up git config
40+
shell: bash
41+
env:
42+
GH_TOKEN: "${{ steps.app-token.outputs.token }}"e
43+
run: |
44+
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
45+
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
46+
git config -l
47+
48+
- name: Install bump-my-version
49+
shell: bash
50+
run: pip install "bump-my-version"
51+
52+
- name: Pass Inputs to Shell
53+
id: bump
54+
shell: bash
55+
working-directory: ./iriscasttools
56+
run: |
57+
echo "previous-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
58+
59+
bump-my-version bump ${{ inputs.bump-type }}
60+
([[ $? -gt 0 ]] && echo "bumped=false" || echo "bumped=true") >> $GITHUB_OUTPUT
61+
echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT
62+
63+
- name: Push changes to GitHub
64+
uses: ad-m/github-push-action@master
65+
with:
66+
github_token: "${{ steps.app-token.outputs.token }}"
67+
branch: master
68+
force: true
69+
70+
- name: Check
71+
if: steps.bump.outputs.bumped == 'true'
72+
run: |
73+
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"
74+
75+
- name: Build package
76+
if: steps.bump.outputs.bumped == 'true'
77+
run: |
78+
pip install build
79+
python -m build
80+
81+
- name: Create GitHub Release
82+
if: steps.bump.outputs.bumped == 'true'
83+
uses: softprops/action-gh-release@v2
84+
with:
85+
tag_name: iriscasttools-v${{ steps.bump.outputs.current-version }}
86+
name: Release ${{ steps.bump.outputs.current-version }}
87+
files: iriscasttools/dist/*
88+
token: "${{ steps.app-token.outputs.token }}"
89+
90+

.github/workflows/iriscast_package_build.yaml

Lines changed: 0 additions & 137 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: IRISCAST Unittest
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "iriscasttools/**"
9+
- ".github/workflows/iriscast_unittest.yaml"
10+
pull_request:
11+
paths:
12+
- "iriscasttools/**"
13+
- ".github/workflows/iriscast_unittest.yaml"
14+
15+
jobs:
16+
test_and_lint:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.x", "3.10"]
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v6
24+
25+
- name: Navigate to Folder
26+
run: cd ./iriscasttools
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v6
30+
with:
31+
python-version: ${{ matrix.python-version }}

0 commit comments

Comments
 (0)