Skip to content

Commit 3e19457

Browse files
committed
Add publish workflow and CI smoke test
1 parent 5b7dc12 commit 3e19457

3 files changed

Lines changed: 62 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ jobs:
5050
run: python -m build
5151
- name: Check package metadata
5252
run: python -m twine check dist/*
53+
- name: Install wheel
54+
run: python -m pip install dist/*.whl
55+
- name: Smoke test CLI
56+
run: |
57+
roc --version
58+
roc run examples/hello.roc | tee /tmp/roc_hello.out
59+
grep -Fx "Hello from Roc!" /tmp/roc_hello.out

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target:
7+
description: "Publish target"
8+
required: true
9+
type: choice
10+
options:
11+
- testpypi
12+
- pypi
13+
default: "testpypi"
14+
dry_run:
15+
description: "Build only, skip upload"
16+
required: false
17+
type: choice
18+
options:
19+
- "false"
20+
- "true"
21+
default: "false"
22+
23+
jobs:
24+
publish:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
- name: Install build tooling
36+
run: python -m pip install --upgrade pip build twine
37+
- name: Build package
38+
run: python -m build
39+
- name: Check package metadata
40+
run: python -m twine check dist/*
41+
- name: Publish to TestPyPI
42+
if: ${{ inputs.target == 'testpypi' && inputs.dry_run != 'true' }}
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
46+
repository-url: https://test.pypi.org/legacy/
47+
- name: Publish to PyPI
48+
if: ${{ inputs.target == 'pypi' && inputs.dry_run != 'true' }}
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
password: ${{ secrets.PYPI_API_TOKEN }}

RELEASE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ Use this checklist to cut a new release.
1111
4. Tag the release
1212
- `git tag vX.Y.Z`
1313
- `git push origin vX.Y.Z`
14-
5. Create a GitHub release
14+
5. Publish package (optional for prototype builds)
15+
- Run the GitHub Actions "Publish" workflow for TestPyPI first.
16+
- If green, rerun for PyPI.
17+
6. Create a GitHub release
1518
- Use the changelog entry as the release notes.

0 commit comments

Comments
 (0)