Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build:
name: Build and release
release:
name: Semantic Release
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

Expand All @@ -31,18 +31,54 @@ jobs:
with:
fetch-depth: 0

- name: Install poetry
- name: Install Poetry
run: pipx install poetry

- uses: actions/setup-node@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create release environment
run: |
mkdir -p release-tools
cd release-tools
npm init -y

- name: Install semantic-release dependencies
working-directory: release-tools
run: |
npm install \
semantic-release \
conventional-changelog-conventionalcommits \
conventional-changelog@^8 \
conventional-changelog-writer@^9 \
@semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
@semantic-release/changelog \
@semantic-release/exec \
@semantic-release/github \
@semantic-release/git \
semantic-release-replace-plugin

- name: Show installed dependencies
working-directory: release-tools
run: |
npm ls \
semantic-release \
@semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
conventional-changelog-conventionalcommits \
conventional-changelog \
conventional-changelog-writer \
--all

- name: Test release
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make release-dry
run: |
release-tools/node_modules/.bin/semantic-release --dry-run --no-ci

- name: Release
if: github.event_name == 'workflow_dispatch'
Expand All @@ -51,7 +87,7 @@ jobs:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi "${PYPI_TOKEN}"
make release
release-tools/node_modules/.bin/semantic-release --ci

docker-push:
name: Push Docker image
Expand Down Expand Up @@ -138,7 +174,7 @@ jobs:
with:
python-version: "3.12"

- name: Install poetry
- name: Install Poetry
run: pipx install poetry

- name: Extract version
Expand Down
25 changes: 0 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ help:

DOCKER = docker compose -p pysus
SERVICE :=
SEMANTIC_RELEASE = npx --yes \
-p semantic-release \
-p conventional-changelog-conventionalcommits \
-p conventional-changelog@^8 \
-p conventional-changelog-writer@^9 \
-p "@semantic-release/commit-analyzer" \
-p "@semantic-release/release-notes-generator" \
-p "@semantic-release/changelog" \
-p "@semantic-release/exec" \
-p "@semantic-release/github" \
-p "@semantic-release/git" \
-p "semantic-release-replace-plugin" \
semantic-release

#* Docker basic
.PHONY: run-jupyter-pysus
Expand All @@ -63,15 +50,3 @@ test-pysus-with-coverage: ## run tests with coverage report
.PHONY: lint
lint:
pre-commit run --all-files

# RELEASE
# =======

.PHONY: release
release:
$(SEMANTIC_RELEASE) --ci


.PHONY: release-dry
release-dry:
$(SEMANTIC_RELEASE) --dry-run --no-ci
Loading