Skip to content

Commit

Permalink
Update github actions to update changelog automatically. (#389)
Browse files Browse the repository at this point in the history
* Created test to see if changelog version can be bumped.

* Gave version bump permissions.

* Gave version system access to full git history.

* Created changelog update version github action

* Create CODE_OF_CONDUCT.md

* Made shell of community documents.

* Made draft contribution guide.

* Started bare changelog.

* Made changelog test.

* Added changelog from previous releases

* Fixed RST syntax.

* Made stub page for scope.

* Made montepy scope and moved design philosophy.

* Made a better landing page, and made the table of contents more nested.

* Fixed section heading error.

* Made clear stance on output files.

* Messed with API TOC to make it actually legible.

* Updated doc test to avoid more undocumented files.

* Fix artifact path.

* Removed deprecated setup python api calls

* Fixed deprecated use of setup python.

* Removed deprecated upload artifacts.

* removed deprecated upload artifacts and test reporter

* removed straggler deprecated upload artifact.

* Actually provided full git history to version bump.

* Only upload one build artifact.

* Updated workflow to have pages after package and to update changelog.

* Update Changelog version to 0.2.7

* Revert "Update Changelog version to 0.2.7"

This reverts commit f7bf982.

* Make sure building pages gets the latest version that was just comitted.

* Update Changelog version to 0.2.8

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
MicahGale and github-actions[bot] authored Mar 9, 2024
1 parent a8404e3 commit ce52566
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 16 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[develop]
- run: python -m pytest

build-pages:
needs: [last-minute-test, build-packages]
environment:
name: github-pages
runs-on: ubuntu-latest
Expand All @@ -27,7 +28,9 @@ jobs:
TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
ref: main
- uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install --user . montepy[doc]
Expand All @@ -53,10 +56,25 @@ jobs:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[build]
- uses: mathieudutour/github-tag-action@v6.1
name: Get next version number (dry)
id: version_num
with:
dry_run: True
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update changelog version
run: |
sed -i "s/#Next Version#/${{steps.version_num.outputs.new_version}}/w changes" doc/source/changelog.rst
[[ -s changes ]] || exit 1
- name: Commit new changelog
uses: actions4git/add-commit-push@v1.0.0
with:
add-pathspec: doc/source
commit-message: Update Changelog version to ${{steps.version_num.outputs.new_version}}
- name: GitHub Actions Create Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
Expand Down Expand Up @@ -85,7 +103,7 @@ jobs:
gh release upload
'${{ steps.tag_version.outputs.new_tag }}' dist/**
--repo '${{ github.repository }}'
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4.3.1
with:
name: build
path: |
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pip build
Expand All @@ -35,7 +35,8 @@ jobs:
- run: pip install --user . montepy[develop]
- run: pip freeze
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
if: ${{ matrix.python-version == '3.9' }}
with:
name: build
path: dist/*
Expand All @@ -50,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user . montepy[test]
Expand All @@ -59,19 +60,19 @@ jobs:
- run: coverage xml
- name: Upload test report
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.1
with:
name: test
path: test_report.xml
- name: Upload coverage report
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.1
with:
name: coverage
path: coverage.xml
- name: Test Reporter
if: ${{ matrix.python-version == '3.9' }}
uses: dorny/test-reporter@v1.7.0
uses: dorny/test-reporter@v1.8.0
with:
name: CI-test-report
path: test_report.xml
Expand All @@ -88,17 +89,30 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[doc]
- uses: mathieudutour/github-tag-action@v6.1
name: Get next version number
id: version_num
with:
dry_run: True
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update changelog version
run: |
sed -i "s/#Next Version#/${{steps.version_num.outputs.new_version}}/w changes" doc/source/changelog.rst
[[ -s changes ]] || exit 1
- run: sphinx-build doc/source/ doc/build/ -W --keep-going -E
- run: sphinx-build -b html doc/source/ doc/build/html
- uses: actions/upload-artifact@v3
name: Build site strictly
- uses: actions/upload-artifact@v4.3.1
with:
name: website
path: doc/build/html
path: doc/build
- name: Test for missing API documentation
run: |
cd doc/source
Expand All @@ -110,7 +124,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[format]
Expand Down
1 change: 0 additions & 1 deletion doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MontePy Changelog
=================


#Next Version#
-----------------------

Expand Down

0 comments on commit ce52566

Please sign in to comment.