Skip to content

Commit 254938b

Browse files
Fix CI (#378)
* update tests to use uv cache * remove sigstore thing from CI/CD. * use a composite action for uv python setup * use uv in makefile * use uv run to run commands inside uv venv * more uvfix in makefile
1 parent 6c662c2 commit 254938b

File tree

4 files changed

+174
-207
lines changed

4 files changed

+174
-207
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Setup Python and uv'
2+
description: 'Setup Python 3.12 and install uv package manager'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Set up Python
7+
uses: actions/setup-python@v5
8+
with:
9+
python-version: "3.12"
10+
11+
- name: Install uv
12+
uses: astral-sh/setup-uv@v7
13+
with:
14+
# Install a specific version of uv.
15+
version: "0.9.17"
16+
enable-cache: true
17+
18+
- name: Create virtual environment
19+
shell: bash
20+
run: uv venv

.github/workflows/pypi.yml

Lines changed: 69 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ name: Build and Publish
55
on: [push, workflow_dispatch]
66

77
jobs:
8-
build:
9-
name: Build
10-
runs-on: ubuntu-22.04
8+
build:
9+
name: Build
10+
runs-on: ubuntu-22.04
1111

12-
steps:
12+
steps:
1313
- uses: actions/checkout@v4
1414

1515
- name: Set up Python
@@ -30,7 +30,7 @@ jobs:
3030
run: python3 -m build browsergym/webarena/ --outdir dist/
3131
- name: Build a binary wheel and a source tarball (browsergym-webarenalite)
3232
run: python3 -m build browsergym/webarenalite/ --outdir dist/
33-
- name: Build a binary wheel and a source tarball (browsergym-webarena)
33+
- name: Build a binary wheel and a source tarball (browsergym-visualwebarena)
3434
run: python3 -m build browsergym/visualwebarena/ --outdir dist/
3535

3636
- name: Build a binary wheel and a source tarball (browsergym-assistantbench)
@@ -48,97 +48,81 @@ jobs:
4848
name: python-package-distributions
4949
path: dist/
5050

51-
publish-to-pypi:
52-
name: Publish to PyPI
53-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
54-
needs:
55-
- build
56-
runs-on: ubuntu-22.04
57-
environment: pypi
58-
permissions:
59-
id-token: write # IMPORTANT: mandatory for trusted publishing
60-
61-
steps:
62-
- name: Download all the distribution packages
63-
uses: actions/download-artifact@v4
64-
with:
65-
name: python-package-distributions
66-
path: dist/
67-
68-
- name: Publish all distribution packages to PyPI
69-
uses: pypa/gh-action-pypi-publish@release/v1
70-
71-
github-release:
72-
name: Sign packages with Sigstore and upload them to GitHub Release
73-
needs:
51+
publish-to-pypi:
52+
name: Publish to PyPI
53+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
54+
needs:
55+
- build
56+
runs-on: ubuntu-22.04
57+
environment: pypi
58+
permissions:
59+
id-token: write # IMPORTANT: mandatory for trusted publishing
60+
61+
steps:
62+
- name: Download all the distribution packages
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: python-package-distributions
66+
path: dist/
67+
68+
- name: Publish all distribution packages to PyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1
70+
71+
github-release:
72+
name: Create GitHub Release
73+
if: startsWith(github.ref, 'refs/tags/')
74+
needs:
7475
- publish-to-pypi
75-
runs-on: ubuntu-22.04
76+
runs-on: ubuntu-22.04
77+
permissions:
78+
contents: write
7679

77-
permissions:
78-
contents: write # IMPORTANT: mandatory for making GitHub Releases
79-
id-token: write # IMPORTANT: mandatory for sigstore
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v4
8083

81-
steps:
8284
- name: Download all the dists
8385
uses: actions/download-artifact@v4
8486
with:
8587
name: python-package-distributions
8688
path: dist/
8789

88-
- name: Sign the dists with Sigstore
89-
uses: sigstore/[email protected]
90-
with:
91-
inputs: >-
92-
./dist/*.tar.gz
93-
./dist/*.whl
94-
9590
- name: Create GitHub Release
9691
env:
9792
GITHUB_TOKEN: ${{ github.token }}
98-
run: >-
99-
gh release create
100-
'${{ github.ref_name }}'
101-
--repo '${{ github.repository }}'
102-
--notes ""
103-
104-
- name: Upload artifact signatures to GitHub Release
105-
env:
106-
GITHUB_TOKEN: ${{ github.token }}
107-
# Upload to GitHub Release using the `gh` CLI.
108-
# `dist/` contains the built packages, and the
109-
# sigstore-produced signatures and certificates.
110-
run: >-
111-
gh release upload
112-
'${{ github.ref_name }}' dist/**
113-
--repo '${{ github.repository }}'
114-
115-
- name: Set GitHub Release as pre-release
116-
if: contains(github.ref, '.dev') # only set tags vA.B.C.devD as pre-release
93+
run: |
94+
gh release create '${{ github.ref_name }}' \
95+
dist/* \
96+
--repo '${{ github.repository }}' \
97+
--title "Release ${{ github.ref_name }}" \
98+
--generate-notes
99+
100+
- name: Set as pre-release if dev version
101+
if: contains(github.ref, '.dev')
117102
env:
118103
GITHUB_TOKEN: ${{ github.token }}
119-
run: >-
120-
gh release edit
121-
'${{ github.ref_name }}'
122-
--repo '${{ github.repository }}'
123-
--prerelease
124-
125-
# publish-to-testpypi:
126-
# name: Publish to TestPyPI
127-
# needs:
128-
# - build
129-
# runs-on: ubuntu-latest
130-
# environment: testpypi
131-
# permissions:
132-
# id-token: write # IMPORTANT: mandatory for trusted publishing
133-
134-
# steps:
135-
# - name: Download all the distribution packages
136-
# uses: actions/download-artifact@v4
137-
# with:
138-
# name: python-package-distributions
139-
# path: dist/
140-
141-
# - name: Publish distribution packages to TestPyPI
142-
# uses: pypa/gh-action-pypi-publish@release/v1
143-
# with:
144-
# repository-url: https://test.pypi.org/legacy/
104+
run: |
105+
gh release edit '${{ github.ref_name }}' \
106+
--repo '${{ github.repository }}' \
107+
--prerelease
108+
109+
# publish-to-testpypi:
110+
# name: Publish to TestPyPI
111+
# needs:
112+
# - build
113+
# runs-on: ubuntu-latest
114+
# environment: testpypi
115+
# permissions:
116+
# id-token: write # IMPORTANT: mandatory for trusted publishing
117+
118+
# steps:
119+
# - name: Download all the distribution packages
120+
# uses: actions/download-artifact@v4
121+
# with:
122+
# name: python-package-distributions
123+
# path: dist/
124+
125+
# - name: Publish distribution packages to TestPyPI
126+
# uses: pypa/gh-action-pypi-publish@release/v1
127+
# with:
128+
# repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)