Skip to content

Conversation

@hleb-rubanau
Copy link

This pull request reproduces previous Travis workflow on GithubActions with some tweaks & enhancements.

Key features:

  • Workflow is named "CI & Release"
  • Separate jobs: linter, test, smoketest, release
  • Linter failure is tolerable
  • Smoketest tries dockerhub login for better pulling but can proceed without it
  • Release is only activated for selected branches (currently: master)
  • If release happens outside of master e.g. during debug on ci/**, artifacts are pushed to testpypi instead of main repo (condition is configurable)

Examples:

After review and before merging:

* tox.ini: tox-gh-actions  integration
* tox.ini: lint removed from envlist, default scope is test-only
* workflows: test job added (matrixed)
* workflows: lint job is separated, no-matrix, non-blocking on failure
* workflows: reusable env lifting steps factored out into ./github/actions
@hleb-rubanau hleb-rubanau self-assigned this Oct 11, 2025
Copy link
Contributor

@dividedmind dividedmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, however I realized we seem to have lost access to the applandrobot pypi user — this might be a good excuse to set up OIDC connect publishing, see https://docs.pypi.org/trusted-publishers/

Could you take a look a that?

@github-actions
Copy link

🎉 This PR is included in version 2.1.9-dev.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dividedmind
Copy link
Contributor

@hleb-rubanau any progress? Do you need anything from me?

@hleb-rubanau
Copy link
Author

hleb-rubanau commented Nov 17, 2025

@hleb-rubanau any progress? Do you need anything from me?

@dividedmind in fact, new version is kinda ready for a while -- I just was delayed with final test (which happens to also include workarounds for lost ownership on testpypi).

Hopefully will conduct it today and push changes.

…ch policies under .releaserc, publish to pypi via trusted publishing mechanism
@hleb-rubanau
Copy link
Author

@dividedmind I've significantly reworked the whole flow

Key changes:

  1. Releasing and publishing jobs are moved to their own release workflow, separate from linting and testing (but smoketest still is run before publishing to master)
  2. Prerelease versions are fully supported (see .releaserc for details). Right now semantic-release is configured to trigger pre-release versions on ephemeral branch which I've used for testing. It can be changed to the branch of choice (develop/dev or similar)
  3. Poetry now only builds artifacts, without publishing them. But exactly those artifacts are reused for all publishing steps.
  4. Semantic-release creates github releases, and publishes artifacts attached to them
  5. Publishing to pypi happens in a separate job, which runs after semantic-release and smoketest, is only activated on selected branches and uses trusted publishing mechanism
    5.1 For branches which name starts with ci, distribution names are altered without commiting and packages are published on test.pypi.org
  6. Travis configuration file is deleted, and all toggles on Travis that trigger builds for the repo are set to off. However, I cannot delete the repo from travis acc.

Remark: I occasionally occupied project 'appmap' on the test.pypi.org and locked myself out of account. That was the reason to use altered distribution names in testpypi publishing flow. Documentation of testpypi promises regular wiping of accounts and assets so we can just wait for some time. If project and my abandoned acc stay there for long, I will try to reach out to platform administrators with explicit deletion request

Copy link
Contributor

@dividedmind dividedmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, LGTM!

I've added getappmap/appmap-python release.yml to trusted publishers. Anything else I need to do?

@hleb-rubanau
Copy link
Author

hleb-rubanau commented Nov 25, 2025

I've added getappmap/appmap-python release.yml to trusted publishers. Anything else I need to do?

No, it should be sufficient. We can merge and check. Also I see someone needs to disable all Travis-related setttings in repo (right now github expects Travis CI check to be completed, which won't happen, because of toggles disabled on Travis side).

@dividedmind
Copy link
Contributor

dividedmind commented Nov 25, 2025

I've added getappmap/appmap-python release.yml to trusted publishers. Anything else I need to do?

No, it should be sufficient. We can merge and check. Also I see someone needs to disable all Travis-related setttings in repo (right now github expects Travis CI check to be completed, which won't happen, because of toggles disabled on Travis side).

Ugh, I wanted to change the branch protection to remove travis and add the gh, but it seems I'd have to add all the matrix jobs one by one. Gemini suggests adding a rollup job to simplify this:

# ... existing jobs ...

  # Add this new job at the end of your file
  check_enforce:
    name: Check (Rollup)
    runs-on: ubuntu-latest
    # Make sure this 'needs' matches the name of your matrix job
    needs: [test]
    if: always()
    steps:
      - name: Check build matrix status
        run: |
          # Check the status of the 'test' job (which includes all matrix variations)
          if [ "${{ needs.test.result }}" != "success" ]; then
            echo "One or more matrix jobs failed."
            exit 1
          fi
          echo "All matrix jobs passed."

Makes sense to me, more or less, what do you think? Can you add it if you think it's a good idea?

@dividedmind
Copy link
Contributor

(It looked like there is a way to make the rule conditional on workflow, not check, but it seems to be only available to enterprise github for now, so do go ahead with the rollup check if you agree it makes sense.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants