Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
w3stling committed Aug 6, 2024
1 parent 7d80504 commit df813c9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
50 changes: 35 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,41 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get version number 🔢
id: get-version
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store next version 🔢
id: version
run: |
echo "next-version=${{ steps.get-version.outputs.tag_name }}" | cut -c -13,15- >> $GITHUB_OUTPUT
- name: Print next version 🔢
run: |
echo "Next version: ${{ steps.version.outputs.next-version }}"
- name: Bump version 🖊️
uses: kurt-code/[email protected]
id: read-properties
with:
operation: 'write'
file-path: 'trading_calendar/__init__.py'
key-value-pairs: '{"__version__": "${{ steps.version.outputs.next-version }}"}'

- name: Commit version update 🔀
uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action-bump-version
with:
commit_message: Bump version to ${{ steps.version.outputs.next-version }}
file_pattern: trading_calendar/__init__.py
branch: main

- name: "Version - changes have been detected 🔍"
if: steps.auto-commit-action-bump-version.outputs.changes_detected == 'true'
run: echo "Updated trading_calendar/__init__.py with version ${{ steps.version.outputs.next-version }} ✅"

- name: Setup Python ⚙️
uses: actions/setup-python@v5
with:
Expand All @@ -37,21 +72,6 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Get version number 🔢
id: get-version
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store next version 🔢
id: version
run: |
echo "next-version=${{ steps.get-version.outputs.tag_name }}" | cut -c -13,15- >> $GITHUB_OUTPUT
- name: Print next version 🔢
run: |
echo "Next version: ${{ steps.version.outputs.next-version }}"

documentation:
name: 📚 Publish API doc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: "Version - changes have been detected 🔍"
if: steps.auto-commit-action-bump-version.outputs.changes_detected == 'true'
run: echo "Updated trading_calendar/__init__.py with release version ${{ env.new_version }} ✅"
run: echo "Updated trading_calendar/__init__.py with version ${{ env.new_version }} ✅"

- name: Display Python version
run: python -c "import sys; print(sys.version)"
Expand Down

0 comments on commit df813c9

Please sign in to comment.