-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from AstarVienna/fh/prepare0.8.4
Prepare for v0.8.4 release
- Loading branch information
Showing
4 changed files
with
222 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,94 @@ | ||
name: Bump package version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
description: Only output new version number, no actual change. | ||
required: false | ||
rule: | ||
type: choice | ||
description: Version bump level | ||
required: true | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
- premajor | ||
- preminor | ||
- prepatch | ||
- prerelease | ||
- "prerelease --next-phase" | ||
|
||
workflow_call: | ||
inputs: | ||
dry-run: | ||
type: boolean | ||
description: Only output new version number, no actual change. | ||
required: false | ||
rule: | ||
type: string | ||
description: Version bump level | ||
required: true | ||
branch: | ||
type: string | ||
description: Branch (ref) to checkout and push changes to | ||
required: false | ||
default: ${{ github.ref_name }} | ||
outputs: | ||
bumpmsg: | ||
description: Message created by the version bump. | ||
value: ${{ jobs.bump.outputs.bumpmsg }} | ||
|
||
jobs: | ||
bump: | ||
name: Bump version number | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
outputs: | ||
bumpmsg: ${{ steps.bumping.outputs.BUMP_MSG }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
|
||
- name: Bump package Version using Poetry | ||
id: bumping | ||
env: | ||
RULE: ${{ inputs.rule }} | ||
DRY: ${{ inputs.dry-run && '--dry-run' || '' }} | ||
run: echo "BUMP_MSG=$(poetry version $DRY $RULE)" >> $GITHUB_OUTPUT | ||
|
||
- name: Output debug msg | ||
if: inputs.dry-run | ||
env: | ||
BUMP_MSG: ${{ steps.bumping.outputs.BUMP_MSG }} | ||
run: | | ||
echo "## $BUMP_MSG" >> $GITHUB_STEP_SUMMARY | ||
echo "Dry run only, no actual modification made." >> $GITHUB_STEP_SUMMARY | ||
- name: Commit changes | ||
# could also use https://github.com/stefanzweifel/git-auto-commit-action instead | ||
if: ${{ ! inputs.dry-run }} | ||
env: | ||
BUMP_MSG: ${{ steps.bumping.outputs.BUMP_MSG }} | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git commit -am "$BUMP_MSG" | ||
git push | ||
echo "## $BUMP_MSG" >> $GITHUB_STEP_SUMMARY | ||
echo "Successfully committed and pushed version bump." >> $GITHUB_STEP_SUMMARY |
This file contains 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,88 @@ | ||
name: Release on PyPI | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
name: Build package using Poetry | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
|
||
- name: Create step summary | ||
run: echo "## Building $(poetry version)" >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Build package | ||
run: poetry build >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Store distribution files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: distribution | ||
path: dist/ | ||
|
||
- name: Upload release attachment | ||
uses: shogo82148/actions-upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: dist/* | ||
|
||
- name: Add to step summary | ||
if: ${{ success() }} | ||
run: echo "### Successfully built package" >> $GITHUB_STEP_SUMMARY | ||
|
||
publish: | ||
name: Publish package to PyPI | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: needs.build.result == 'success' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
poetry-version: "1.8.3" | ||
|
||
- name: Create step summary | ||
run: echo "## Publishing $(poetry version) to PyPI" >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Retrieve distribution files | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: distribution | ||
path: dist/ | ||
|
||
- name: Publish to PyPI | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
run: poetry publish >> $GITHUB_STEP_SUMMARY | ||
|
||
bump: | ||
name: Bump to (next) dev version | ||
needs: publish | ||
if: ${{ needs.publish.result == 'success' }} | ||
uses: ./.github/workflows/bump.yml | ||
secrets: inherit | ||
with: | ||
rule: prerelease | ||
branch: main |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "ScopeSim" | ||
version = "0.8.4a0" | ||
version = "0.8.4rc0" | ||
description = "Generalised telescope observation simulator" | ||
license = "GPL-3.0-or-later" | ||
authors = ["Kieran Leschinski <[email protected]>"] | ||
|