Skip to content

Commit

Permalink
Fix github release action
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Aug 16, 2024
1 parent c6053a5 commit 4143220
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
node-version: '20'
- name: Build rustlib
working-directory: rustlib
run: wasm-pack build --target web
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Build bundle.js
working-directory: optuna_dashboard
run: |
npm install
npm run build:prd
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: python -m build --sdist --wheel
- run: make python-package
- run: twine check dist/*

- name: Create GitHub release
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Build bundle.js
working-directory: optuna_dashboard
run: |
npm install
npm run build:prd
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: python -m build --sdist --wheel
- run: make python-package

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 18 additions & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
architecture: x64
- name: Install dependencies
run: |
Expand All @@ -26,6 +26,23 @@ jobs:
- run: black --check --diff .
- run: isort --check --diff .
- run: mypy optuna_dashboard python_tests
build-python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off wheel twine build
- run: make python-package
test:
runs-on: ubuntu-latest
strategy:
Expand Down
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DEFAULT_GOAL := sdist
.DEFAULT_GOAL := python-package

PYTHON ?= python3
MODE ?= dev
Expand All @@ -15,7 +15,7 @@ $(RUSTLIB_OUT): rustlib/src/*.rs rustlib/Cargo.toml
vscode/assets/bundle.js: $(RUSTLIB_OUT) $(STANDALONE_SRC) tslib
cd standalone_app && npm install && npm run build:vscode

$(DASHBOARD_TS_OUT): $(DASHBOARD_TS_SRC)
$(DASHBOARD_TS_OUT): $(DASHBOARD_TS_SRC) tslib
cd optuna_dashboard && npm install && npm run build:$(MODE)

.PHONY: tslib
Expand All @@ -31,24 +31,21 @@ tslib-test: tslib

.PHONY: serve-browser-app
serve-browser-app: tslib $(RUSTLIB_OUT)
cd standalone_app && npm install && npm run watch
cd standalone_app && npm i && npm run watch

.PHONY: vscode-extension
vscode-extension: vscode/assets/bundle.js
cd vscode && npm install && npm run vscode:prepublish && vsce package
cd vscode && npm i && npm run vscode:prepublish && vsce package

.PHONY: jupyterlab-extension
jupyterlab-extension: tslib
cd optuna_dashboard && npm install && npm run build:pkg
cd jupyterlab && python -m build --sdist

.PHONY: sdist
sdist: pyproject.toml $(DASHBOARD_TS_OUT)
python -m build --sdist

.PHONY: wheel
wheel: pyproject.toml $(DASHBOARD_TS_OUT)
python -m build --wheel
.PHONY: python-package
python-package: pyproject.toml tslib
cd optuna_dashboard && npm i && npm run build:prd
python -m build --sdist --wheel

.PHONY: docs
docs: docs/conf.py $(RST_FILES)
Expand All @@ -64,4 +61,4 @@ fmt:
clean:
rm -rf tslib/types/pkg tslib/storage/pkg tslib/react/pkg tslib/react/types
rm -rf optuna_dashboard/public/ doc/_build/
rm -rf rustlib/pkg standalone_app/public/ vscode/assets/ vscode/*.vsix
rm -rf rustlib/pkg vscode/assets/ vscode/*.vsix

0 comments on commit 4143220

Please sign in to comment.