v0.3.7 #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # need tags to generate release notes | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
id: build | |
run: | | |
poetry build | |
echo "py_wheel_name=evmole-${GITHUB_REF#refs/tags/}-py3-none-any.whl" >> $GITHUB_OUTPUT | |
# js: | |
cp ./README.md js/README.md | |
pushd js/ | |
npm run build | |
npm pack | |
echo "js_tarball_name=evmole-${GITHUB_REF#refs/tags/}.tgz" >> $GITHUB_OUTPUT | |
popd | |
# rust: | |
cp ./README.md rust/README.md | |
- name: Release Notes | |
run: | | |
echo '## Changes since previous release:' > changelog.md | |
git log --oneline $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- [%h](https://github.com/cdump/evmole/commit/%H) %s" >> changelog.md | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
body_path: changelog.md | |
files: | | |
dist/${{ steps.build.outputs.py_wheel_name }} | |
js/${{ steps.build.outputs.js_tarball_name }} | |
- name: Publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry publish | |
pushd rust && cargo publish --allow-dirty && popd | |
pushd js && npm publish && popd |