Skip to content

Commit

Permalink
refactor: update libsansmic cpp code (#79)
Browse files Browse the repository at this point in the history
* refactor: change the way logging is done, make output directories more explicit (not enforced yet)

* style: apply black formatting

* ci: change testing output to use 'tee' instead of redirect

* test: no subprocess test in ipynb on linux

* test: strip metadata by hand from ipynb

* refactor: modify logging output formats

* refactor: move certain elements out of Model into a BaseModel

* refactor(version): move location of version number to avoid circular imports

* refactor(test): fix test to match refactor of license and copyright text names
  • Loading branch information
dbhart committed Oct 29, 2024
1 parent fe93962 commit ed6ddd8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 15 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/continuous-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: Check release

on:
pull_request:
pull_request_target:

permissions:
contents: read
Expand All @@ -14,8 +14,8 @@ jobs:
concurrency: release

permissions:
id-token: write
pull-requests: write
id-token: write

steps:
- name: Setup | Harden Runner
Expand Down Expand Up @@ -46,12 +46,16 @@ jobs:
tag: false
vcs_release: false

- name: Action | Comment on PR with new version
run: |
- run: |
echo "## The results of python-semantic-release are below." | tee -a "$GITHUB_STEP_SUMMARY"
echo "* released: ${{ steps.check.outputs.released }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* is_prerelease: ${{ steps.check.outputs.is_prerelease }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* version: ${{ steps.check.outputs.version }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* tag: ${{ steps.check.outputs.tag }}" | tee -a "$GITHUB_STEP_SUMMARY"
# echo "The release number should be ${{ steps.check.outputs.version }}" >> release.md
gh pr comment ${{ github.event.pull_request.number }} --body "This PR should include a release: ${{ steps.check.outputs.released }}\n"
- name: Action | Comment on PR with new version
if: ${{ steps.check.outputs.released == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "This PR will induce a release as v${{ steps.check.outputs.version }}\n"
43 changes: 35 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,10 @@ jobs:
path: dist
merge-multiple: true

- name: Setup | Download the standalone executable
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: sansmic-*-standalone-win_amd64
path: dist
merge-multiple: true

- name: Action | Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
with:
inputs: >-
./dist/*.zip
./dist/*.tar.gz
./dist/*.whl
Expand All @@ -230,3 +222,38 @@ jobs:
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
release-standalone:
needs:
- github-release
- build_executable
name: >-
Sign the standalone with Sigstore and upload to GitHub Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') && github.repository == 'sandialabs/sansmic' }}
steps:
- name: Setup | Download the standalone executable
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: sansmic-*-standalone-win_amd64
path: dist/
merge-multiple: false

- name: Zip up dist directory
run: |
cd dist
zip ../sansmic-${{ env.sansmic_version }}-standalone-win_amd64.zip *
- name: Action | Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
with:
inputs: >-
./sansmic-${{ env.sansmic_version }}-standalone-win_amd64.zip
- name: Action | Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' sansmic-${{ env.sansmic_version }}-standalone-win_amd64.zip
--repo '${{ github.repository }}'
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ match = "(main|master|staging)"
prerelease_token = "rc"
prerelease = false

[tool.semantic_release.branches.merge]
match = "[0-9]+/merge"
prerelease_token = "rc"
prerelease = false

[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = ["build", "ci", "chore", "^Bump", "release"]
exclude_commit_patterns = ["build", "ci", "chore", "^Bump", "release", "^Merge branch"]

[tool.semantic_release.changelog.environment]
block_start_string = "{%"
Expand Down

0 comments on commit ed6ddd8

Please sign in to comment.