Skip to content

Commit 35b4e70

Browse files
committed
handle publish with GH CI
1 parent 0ab41b7 commit 35b4e70

2 files changed

Lines changed: 93 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,91 @@ jobs:
191191
env:
192192
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193193

194-
# Publishing to crates.io, npm, PyPI, and RubyGems is handled locally
195-
# via bin/publish.sh after the release workflow completes.
194+
publish-crates:
195+
name: Publish to crates.io
196+
needs: [release]
197+
runs-on: ubuntu-latest
198+
steps:
199+
- uses: actions/checkout@v4
200+
201+
- name: Install Rust toolchain
202+
uses: dtolnay/rust-toolchain@stable
203+
204+
- name: Publish inky-core
205+
run: cargo publish -p inky-core
206+
env:
207+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
208+
209+
- name: Publish inky-cli
210+
run: cargo publish -p inky-cli
211+
env:
212+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
213+
214+
publish-npm:
215+
name: Publish to npm
216+
needs: [release]
217+
runs-on: ubuntu-latest
218+
steps:
219+
- uses: actions/setup-node@v4
220+
with:
221+
registry-url: https://registry.npmjs.org
222+
223+
- name: Download WASM artifact
224+
uses: actions/download-artifact@v4
225+
with:
226+
name: wasm-nodejs
227+
path: .
228+
229+
- name: Extract and publish
230+
run: |
231+
tar xzf inky-wasm-nodejs.tar.gz
232+
cd node
233+
VERSION=$(node -p "require('./package.json').version")
234+
if echo "$VERSION" | grep -qE '(alpha|beta|rc|dev)'; then
235+
npm publish --access public --tag beta
236+
else
237+
npm publish --access public
238+
fi
239+
env:
240+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
241+
242+
publish-pypi:
243+
name: Publish to PyPI
244+
needs: [release]
245+
runs-on: ubuntu-latest
246+
steps:
247+
- uses: actions/checkout@v4
248+
249+
- uses: actions/setup-python@v5
250+
with:
251+
python-version: '3.x'
252+
253+
- name: Build and publish
254+
run: |
255+
pip install build twine
256+
cd bindings/python
257+
python -m build
258+
twine upload dist/*
259+
env:
260+
TWINE_USERNAME: __token__
261+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
262+
263+
publish-rubygems:
264+
name: Publish to RubyGems
265+
needs: [release]
266+
runs-on: ubuntu-latest
267+
steps:
268+
- uses: actions/checkout@v4
269+
270+
- uses: ruby/setup-ruby@v1
271+
with:
272+
ruby-version: '3.3'
273+
274+
- name: Build and publish
275+
run: |
276+
cd bindings/ruby
277+
gem build inky-email.gemspec
278+
GEM_FILE=$(ls inky-email-*.gem | head -1)
279+
gem push "$GEM_FILE"
280+
env:
281+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

bin/release.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,10 @@ else
169169
echo "Warning: inky-go repo not found at ../inky-go — skipping Go module tag."
170170
fi
171171

172-
# Publish to package registries
173-
echo ""
174-
read -r -p "==> Publish to package registries now? [y/N] " response
175-
if [[ "$response" =~ ^[Yy]$ ]]; then
176-
bin/publish.sh
177-
fi
172+
# Publishing to crates.io, npm, PyPI, and RubyGems is handled by the
173+
# release workflow in CI. If any publish step fails, use bin/publish.sh
174+
# as a manual fallback.
178175

179176
echo "==> Done! Inky $TAG has been released."
177+
echo " Publishing to registries will happen automatically via CI."
178+
echo " If needed, run bin/publish.sh as a fallback."

0 commit comments

Comments
 (0)