diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index f58e6a6..1609bbb 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -10,18 +10,11 @@ jobs: concurrency: group: ${{ github.workflow }}-release-${{ github.ref_name }} cancel-in-progress: false - if: ${{ github.event.workflow_run.conclusion == 'success' }} outputs: release_made: ${{ steps.release_step.outputs.release_made }} permissions: contents: write steps: - # Note: We checkout the repository at the branch that triggered the workflow - # with the entire history to ensure to match PSR's release branch detection - # and history evaluation. - # However, we forcefully reset the branch to the workflow sha because it is - # possible that the branch was updated while the workflow was running. This - # prevents accidentally releasing un-evaluated changes. - name: Setup | Checkout Repository on Release Branch uses: actions/checkout@v6 with: @@ -37,13 +30,6 @@ jobs: run: | git reset --hard ${{ github.sha }} - name: Evaluate | Verify upstream has NOT changed - # Last chance to abort before causing an error as another PR/push was applied to - # the upstream branch while this workflow was running. This is important - # because we are committing a version change (--commit). You may omit this step - # if you have 'commit: false' in your configuration. - # - # You may consider moving this to a repo script and call it from this step instead - # of writing it in-line. shell: bash run: | set +o pipefail @@ -78,13 +64,13 @@ jobs: - name: Semantic Version Release id: release_step env: - TWINE_USERNAME: "__token__" # Username for Twine when using token-based auth - TWINE_PASSWORD: ${{ secrets.PIP_REPOSITORY_API_TOKEN }} # Use the secret for authentication - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PIP_REPOSITORY_API_TOKEN }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} run: | pip install python-semantic-release==9.* wheel build twine semantic-release --config ./ci/semantic_release.toml version if [ ! -d dist ]; then echo No release will be made; echo "release_made=false" >> "$GITHUB_OUTPUT"; exit 0; fi echo "release_made=true" >> "$GITHUB_OUTPUT" - twine upload dist/* --repository-url https://gitea.psi.ch/api/packages/mx/pypi -u __token__ -p ${{ secrets.CI_PYPI_TOKEN }} --skip-existing + twine upload dist/* --repository-url https://gitea.psi.ch/api/packages/mx/pypi semantic-release publish diff --git a/ci/semantic_release.toml b/ci/semantic_release.toml index 09e1b68..a922328 100644 --- a/ci/semantic_release.toml +++ b/ci/semantic_release.toml @@ -26,12 +26,11 @@ patch_tags = ["fix", "perf"] default_bump_level = 0 [tool.semantic_release.remote] -name = "origin" -type = "github" -ignore_token_for_push = true +type = "gitea" +domain = "gitea.psi.ch" [tool.semantic_release.remote.token] -env = "GH_TOKEN" +env = "GITEA_TOKEN" [tool.semantic_release.publish] dist_glob_patterns = ["dist/*"] diff --git a/pyproject.toml b/pyproject.toml index 56b2ca7..4561511 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "aarecommon" -version = "0.1" +version = "0.1.0" description = "Common components (models, calculations) for Aare packages" readme = "README.md" requires-python = ">=3.11"