Skip to content

Commit 9beefc1

Browse files
authored
Update readme and add scheduled trigger (#4)
* Add readme and add scheduled trigger * Fix cli
1 parent c1ee5ce commit 9beefc1

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

.github/workflows/build.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Build Cross-build environment for pyodide-build
22

33
on:
44
pull_request:
5+
push:
6+
branches:
7+
- main
58
workflow_dispatch:
6-
release:
7-
types: [published]
9+
schedule:
10+
# Run at 00:00 UTC on the 1st, 10th, and 20th of every month
11+
- cron: '0 0 1,10,20 * *'
812

913
concurrency:
1014
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -96,8 +100,8 @@ jobs:
96100
needs: [build]
97101
if: >-
98102
github.repository == 'pyodide/pyodide-build-environment-nightly' &&
99-
github.event_name == 'release' &&
100-
github.event.action == 'published'
103+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) ||
104+
(github.event_name == 'schedule')
101105
permissions:
102106
# Required to sign the attestations
103107
id-token: write
@@ -116,6 +120,18 @@ jobs:
116120
with:
117121
subject-path: |
118122
dist/xbuildenv.tar.bz
123+
124+
- name: Calc release version
125+
id: release_version
126+
shell: bash
127+
run: |
128+
if [[ ${{ github.event_name }} == 'schedule' ]]; then
129+
echo "release_version=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
130+
else
131+
echo "release_version=${{ github.ref }}" >> $GITHUB_OUTPUT
132+
fi
133+
134+
cat $GITHUB_OUTPUT
119135
120136
- name: Verify them, to ensure that the wheels they were attested correctly
121137
env:
@@ -126,12 +142,8 @@ jobs:
126142
127143
- name: Create GitHub release with these wheels
128144
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
129-
if: >-
130-
github.repository == 'pyodide/pyodide-build-environment-nightly' &&
131-
github.event_name == 'release' &&
132-
github.event.action == 'published'
133145
with:
134146
files: |
135147
dist/*.tar.bz
136148
fail_on_unmatched_files: true
137-
name: Pyodide cross-build environment
149+
name: ${{ steps.release_version.outputs.release_version }}

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# pyodide-build-environment-nightly
2+
23
Nightly cross build environments for building Pyodide packages
4+
5+
## Usage
6+
7+
This repository contains nightly cross build environments for building Pyodide packages.
8+
The target user of this repository is package maintainers who want to build their packages against the unreleased version of Pyodide.
9+
10+
Each release in this repository contains a tip-of-tree build of Pyodide of the given date.
11+
You can use the `pyodide xbuildenv install` command to install the build environment for a given date.
12+
13+
```bash
14+
pip install pyodide-build
15+
16+
# Change the date to the date of the build you want to use
17+
pyodide xbuildenv install --url "https://github.com/pyodide/pyodide-build-environment-nightly/releases/download/20250125/xbuildenv.tar.bz"
18+
19+
# Now you can use the build environment to build your package
20+
pyodide build
21+
```
22+
23+
## Maintainer Notes
24+
25+
The build environment is periodically built and released by GHA.
26+
27+
Otherwise, if you want to manually trigger a build, you can create a new tag.
28+
Creating a tag will trigger a GHA workflow that builds the cross build environment and uploads it as a release asset.

0 commit comments

Comments
 (0)