-
Notifications
You must be signed in to change notification settings - Fork 19
76 lines (64 loc) · 1.95 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org/'
- name: Install python poetry
run: |
curl -sSL https://install.python-poetry.org | python -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Python - check and build
id: buildpy
run: |
poetry install
poetry run ruff evmole
poetry run black --check evmole
poetry build
echo "wheel_name=evmole-${GITHUB_REF#refs/tags/}-py3-none-any.whl" >> $GITHUB_OUTPUT
- name: NodeJS - check and build
id: buildjs
run: |
cd js/
npm ci
npm run build
npm pack
echo "tarball_name=evmole-${GITHUB_REF#refs/tags/}.tgz" >> $GITHUB_OUTPUT
- name: Generate 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.buildpy.outputs.wheel_name }}
js/${{ steps.buildjs.outputs.tarball_name }}
- name: Publish to NPM and PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
poetry publish
cd js && npm publish