pre_release_workflow #4
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
name: pre_release_workflow | |
on: | |
workflow_dispatch: | |
inputs: | |
tagName: | |
description: 'Tag to create' | |
required: true | |
type: string | |
default: 'vX.Y.Z' | |
jobs: | |
pin_dependency_versions: | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
architecture: x64 | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Reset pinned hash versions | |
run: .github/workflows/pin_versions.py --unpin | |
- name: Install with latest dependencies | |
run: pip install -e .[dev] | |
- id: pin_versions | |
name: Pin Versions | |
run: | | |
MSG=$(.github/workflows/pin_versions.py) | |
echo "COMMIT_MESSAGE=\"$MSG\"" >> "$GITHUB_OUTPUT" | |
- name: Add setup.cfg | |
run: | | |
git add setup.cfg | |
- name: Commit changes | |
run: | | |
git config --global user.name "GitHub Workflow" | |
git config --global user.email "[email protected]" | |
git commit -m ${{steps.pin_versions.outputs.COMMIT_MESSAGE}} | |
git tag ${{inputs.tagName}} | |
git push origin ${{inputs.tagName}} | |
- name: Create Release | |
run: gh release create --generate-notes --draft ${{inputs.tagName}} | |
- name: Edit Release Notes | |
run: | | |
echo -e "${{ steps.pin_versions.outputs.COMMIT_MESSAGE }}\n\n" > "$RUNNER_TEMP/relnotes.txt" | |
gh release view ${{ inputs.tagName }} | sed '0,/^--$/d' >> "$RUNNER_TEMP/relnotes.txt" | |
gh release edit ${{ inputs.tagName }} --notes-file "$RUNNER_TEMP/relnotes.txt" |