revert(auth): restore email/password agelo login #4
This file contains hidden or 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: build-package | |
| # Builds the agelo-cli wheel + sdist and publishes them as assets on | |
| # a GitHub Release tagged with the GitVersion-derived AssemblySemVer. | |
| # | |
| # GitHub doesn't host Python packages natively (Packages supports only | |
| # npm / Maven / NuGet / RubyGems / Docker). GitHub Releases is the | |
| # canonical path for distributing a Python wheel under the github.com | |
| # domain, and it integrates with `pip install <release-asset-url>`. | |
| # | |
| # Triggers | |
| # - push to master → cut a new release | |
| # - workflow_dispatch → re-run on demand against any ref | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: Ref (branch / tag / SHA) to build from | |
| required: false | |
| permissions: | |
| contents: write # create releases + push tags | |
| jobs: | |
| version: | |
| name: gitversion / compute | |
| runs-on: ubuntu-latest | |
| outputs: | |
| assemblySemVer: ${{ steps.gv.outputs.assemblySemVer }} | |
| semVer: ${{ steps.gv.outputs.semVer }} | |
| majorMinor: ${{ steps.gv.outputs.major }}.${{ steps.gv.outputs.minor }} | |
| shortSha: ${{ steps.gv.outputs.shortSha }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| fetch-depth: 0 | |
| - uses: gittools/actions/gitversion/setup@v3.2.1 | |
| with: | |
| versionSpec: '6.x' | |
| - id: gv | |
| uses: gittools/actions/gitversion/execute@v3.2.1 | |
| with: | |
| useConfigFile: true | |
| configFilePath: gitversion.yml | |
| - run: | | |
| echo "AssemblySemVer = ${{ steps.gv.outputs.assemblySemVer }}" | |
| echo "SemVer = ${{ steps.gv.outputs.semVer }}" | |
| echo "ShortSha = ${{ steps.gv.outputs.shortSha }}" | |
| package: | |
| name: build / wheel + sdist | |
| needs: version | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| outputs: | |
| assemblySemVer: ${{ needs.version.outputs.assemblySemVer }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install build tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Stamp AssemblySemVer into pyproject.toml | |
| run: | | |
| python - <<'PY' | |
| import pathlib, re, sys | |
| version = "${{ needs.version.outputs.assemblySemVer }}" | |
| path = pathlib.Path("pyproject.toml") | |
| original = path.read_text(encoding="utf-8") | |
| patched = re.sub( | |
| r'^version\s*=\s*".*"', | |
| f'version = "{version}"', | |
| original, | |
| count=1, | |
| flags=re.MULTILINE, | |
| ) | |
| if patched == original: | |
| print("ERROR: no version line replaced", file=sys.stderr) | |
| sys.exit(1) | |
| path.write_text(patched, encoding="utf-8") | |
| print(f"pyproject.toml version pinned to {version}") | |
| PY | |
| - name: Build wheel + sdist | |
| run: python -m build | |
| - name: Twine check | |
| run: twine check dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 30 | |
| release: | |
| name: github / release | |
| needs: [version, package] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.version.outputs.assemblySemVer }} | |
| name: agelo-cli v${{ needs.version.outputs.assemblySemVer }} | |
| body: | | |
| **agelo-cli `${{ needs.version.outputs.assemblySemVer }}`** | |
| Built from commit `${{ needs.version.outputs.shortSha }}`. | |
| Install: | |
| ```bash | |
| pip install https://github.com/${{ github.repository }}/releases/download/v${{ needs.version.outputs.assemblySemVer }}/agelo_cli-${{ needs.version.outputs.assemblySemVer }}-py3-none-any.whl | |
| ``` | |
| files: | | |
| dist/*.whl | |
| dist/*.tar.gz | |
| fail_on_unmatched_files: true | |
| generate_release_notes: true |