@@ -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 }}
0 commit comments