-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add activestate OIDC docs #15548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add activestate OIDC docs #15548
Changes from 8 commits
af1d7e3
68b68fe
9117ec2
60865bc
3980d61
5cffe67
6b9d4fd
320f06a
13d039a
002cddd
1761ef1
01912b9
bb88d45
ca7870d
b33393c
5624a88
5fde6ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,7 +97,12 @@ each. | |
|
|
||
| === "ActiveState" | ||
|
|
||
| TODO | ||
| For ActiveState, you need to provide the project name on ActiveState's Platform, | ||
| the organization that project belongs to, and the username performing | ||
th3coop marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| the publish action. Learn more about getting set up on the ActiveState Platform [here](https://docs.activestate.com/platform/start/PYPI). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming this URL will start resolving sometime after we enable this feature?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, correct. It should be live soon. We'll get it set up so that it can be viewable before we go live. |
||
|  | ||
| Once you click "Add", your publisher will be registered and will appear at the top of the page: | ||
|  | ||
|
|
||
| === "GitLab CI/CD" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,23 @@ own security model and considerations. | |
|
|
||
| === "ActiveState" | ||
|
|
||
| TODO | ||
| ### Security Model | ||
|
|
||
| Trusted Publishing occurs from within an isolated build container in the ActiveState | ||
| Platform build infrastructure. When a build is triggered by a user that will publish | ||
| to PyPI, an OIDC token is generated and passed into the necessary build container as | ||
| an environmental variable along with your release artifact that will be uploaded. The | ||
th3coop marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| OIDC token is used by the build container to request a PyPI API token which it then | ||
| uses to upload your release. | ||
|
|
||
| ### Considerations | ||
|
|
||
| * The user configured in the Trusted Publisher must be the user that triggers the | ||
| build in the ActiveState Platform. This user will need editing privileges in the | ||
| ActiveState organization associated with the project. | ||
| * The ActiveState Platform project must be private. | ||
| For more information about Trusted Publishing using the ActiveState Platform please | ||
| see the [PyPI configuration documentation](https://docs.activestate.com/platform/start/PYPI) and the [ActiveState Platform documentation](https://docs.activestate.com/platform). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: https://docs.activestate.com/platform/start/PYPI currently 404s, but that may be intended.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. They will be up soon. |
||
|
|
||
| === "GitLab CI/CD" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,7 +270,47 @@ below describe the setup process for each supported trusted publisher. | |
|
|
||
| === "ActiveState" | ||
|
|
||
| TODO | ||
| ActiveState's Platform works as a "zero-config" CI solution to automatically build cross-platform wheels of your PyPI projects. Once you're set up on the Platform and have linked your PyPI project, you're ready to publish. For more information on getting started with ActiveState go [here](https://docs.activestate.com/platform/start/PYPI). To begin: | ||
|
||
| Publish your package to ActiveState's catalog. This will allow ActiveState's Platform to build it for you. | ||
|
|
||
| 1. Run the following command using the State Tool CLI: | ||
| ``` | ||
| state publish --namespace USERNAME/python --name PKG_NAME SDIST_FILENAME --depend "builder/python-module-builder@>=0" --depend "language/python@>=3" --depend "language/python/setuptools@>=43.0.0" --depend "language/python/wheel@>=0" | ||
| ``` | ||
| Replace the placeholder values in the block above with your ActiveState username (USERNAME), package name (PKG_NAME), and the filename of your sdist (SDIST_FILENAME) and run the command. | ||
|
|
||
| 2. After publishing your package to ActiveState, you'll need to create a build script file (`buildscript.as`) to build it into a wheel and publish it to PyPI. An example script is shown below. Create a new build script file in the same folder as your `activestate.yaml` file and name it `buildscript.as`. Paste the code below, substituting the placeholder values with those from your project: your ActiveState username (USERNAME), the name of the namespace (ie. folder where you published the ingredient, in this case `python`) (NAMESPACE), and finally the name of your package (PKG_NAME). Save the changes to the file. | ||
| ```python | ||
| at_time = "2023-12-19T22:53:09.573000Z" | ||
| sources = solve( | ||
| at_time = at_time, | ||
| platforms = [ | ||
| "78977bc8-0f32-519d-80f3-9043f059398c", | ||
| "7c998ec2-7491-4e75-be4d-8885800ef5f2", | ||
| "96b7e6f2-bebf-564c-bc1c-f04482398f38" | ||
| ], | ||
| requirements = [ | ||
| Req(name = "USERNAME/NAMESPACE/PKG_NAME, version=Eq("1.0.0")) | ||
| ], | ||
| ) | ||
| wheels = wheel_artifacts(src=$sources) | ||
| publish_receipt = pypi_publisher(src=$wheels) | ||
| runtime = state_tool_artifacts_v1( | ||
| build_flags = [ | ||
| ], | ||
| src = sources | ||
| ) | ||
| main = runtime | ||
| ``` | ||
|
|
||
| 1. Then, "commit" this build script to the system by running `state commit` in your terminal. Now you're ready to publish to PyPI! | ||
| 2. To build your wheel, run `state eval wheels` | ||
| 3. After building your wheel, run `state builds --all` to view all of the builds available. Take note of the `HASH_ID` of your new wheel. | ||
| 4. Run `state builds dl <HASH_ID>` to download and test the wheel you've built. | ||
| 5. When you're ready to publish your wheel to PyPI, run: `state eval publish_receipt`. | ||
| That's it! | ||
|
|
||
| You have successfully published a Python wheel using the ActiveState Platform. | ||
|
|
||
| === "GitLab CI/CD" | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.