Skip to content

Commit 917b5a2

Browse files
Prepare release (#42)
* Add Dependabot * Revamp main workflow * Revamp release workflow * Note more Pyodide ecosystem packages
1 parent 9312f14 commit 917b5a2

File tree

5 files changed

+101
-32
lines changed

5 files changed

+101
-32
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"

.github/workflows/main.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,37 @@
11
name: main
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

5-
permissions:
6-
contents: read
9+
permissions: {}
710

811
concurrency:
912
group: main-${{ github.head_ref || github.run_id }}
1013
cancel-in-progress: true
1114

1215
jobs:
1316
test:
17+
permissions:
18+
contents: read
1419
strategy:
1520
matrix:
1621
runs-on: [ubuntu-latest, macos-latest]
1722
fail-fast: false
1823
runs-on: ${{ matrix.runs-on }}
1924
steps:
20-
- uses: actions/[email protected]
21-
- uses: actions/[email protected]
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2230
with:
2331
python-version: 3.12
32+
2433
- name: Install
25-
shell: bash -l {0}
26-
run: |
27-
python -m pip install -e ".[test]"
28-
- name: Test
29-
shell: bash -l {0}
30-
run: |
31-
python -m pytest
32-
deploy:
33-
runs-on: ubuntu-latest
34-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
35-
environment: PyPi-deploy
36-
steps:
37-
- uses: actions/[email protected]
34+
run: python -m pip install -e ".[test]"
3835

39-
- uses: actions/[email protected]
40-
- name: Install requirements and build wheel
41-
shell: bash -l {0}
42-
run: |
43-
python -m pip install build twine
44-
python -m build .
45-
- name: Publish package
46-
uses: pypa/gh-action-pypi-publish@release/v1
47-
with:
48-
user: __token__
49-
password: ${{ secrets.PYPI_API_TOKEN }}
36+
- name: Test
37+
run: python -m pytest

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 3 * * 1"
9+
10+
env:
11+
FORCE_COLOR: 3
12+
13+
permissions: {}
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
steps:
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
28+
with:
29+
python-version: "3.12"
30+
31+
- name: Build
32+
run: |
33+
python -m pip install build
34+
python -m build .
35+
36+
- name: Store the distribution packages
37+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
38+
with:
39+
name: python-package-distributions
40+
path: dist/
41+
if-no-files-found: error
42+
43+
publish:
44+
name: Publish to PyPI
45+
needs: [build]
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'release' && github.event.action == 'published'
48+
environment:
49+
name: pypi
50+
url: https://pypi.org/p/pyodide-cli
51+
permissions:
52+
id-token: write # IMPORTANT: mandatory for trusted publishing
53+
attestations: write
54+
contents: read
55+
steps:
56+
- name: Download all the dists
57+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
58+
with:
59+
path: dist/
60+
merge-multiple: true
61+
62+
- name: Generate artifact attestations
63+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
64+
with:
65+
subject-path: "dist/*"
66+
67+
- name: Publish distribution 📦 to PyPI
68+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# pyodide-cli
22

33
[![PyPI Latest Release](https://img.shields.io/pypi/v/pyodide-cli.svg)](https://pypi.org/project/pyodide-cli/)
4-
![GHA](https://github.com/pyodide/pyodide-cli/actions/workflows/main.yml/badge.svg)
4+
![GHA-main](https://github.com/pyodide/pyodide-cli/actions/workflows/main.yml/badge.svg)
5+
![GHA-release](https://github.com/pyodide/pyodide-cli/actions/workflows/release.yml/badge.svg)
56
[![codecov](https://codecov.io/gh/pyodide/pyodide-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/pyodide/pyodide-cli)
67

78
The command line interface for the Pyodide project.
89

910
In most cases, you do not need to install this package directly, and it would be installed as
10-
a dependency of other packages in the ecosystem (e.g. pyodide-build).
11+
a dependency of other packages in the ecosystem (e.g., pyodide-build, pyodide-pack, auditwheel-emscripten, etc.)
1112

1213
## Installation
1314

pyodide_cli/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def callback(
4545
"""A command line interface for Pyodide.
4646
4747
Other CLI subcommands are registered via the plugin system by installing
48-
Pyodide compatible packages (e.g. pyodide-build).
48+
Pyodide ecosystem packages (e.g. pyodide-build, pyodide-pack,
49+
auditwheel-emscripten, etc.)
4950
"""
5051
pass
5152

0 commit comments

Comments
 (0)