Skip to content

Commit 3d66866

Browse files
committed
chore: semantic-release を Nx Release に置き換え
- nx, @nx/js, @swc-node/register, @swc/core を追加 - semantic-release, semantic-release-npm-workspaces-monorepo を削除 - nx.json を作成(independent versioning, updateDependents, GitHub Release 自動生成) - release.yml のタグトリガーを *@* 形式に変更し nx release publish を使用 - scripts/publish.sh を削除(nx release publish で代替)
1 parent 608ec37 commit 3d66866

File tree

6 files changed

+504
-955
lines changed

6 files changed

+504
-955
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- "@wdprlib/ast@*"
7+
- "@wdprlib/parser@*"
8+
- "@wdprlib/render@*"
9+
- "@wdprlib/runtime@*"
710

811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
@@ -17,6 +20,15 @@ jobs:
1720
contents: write
1821
id-token: write
1922
steps:
23+
- name: Extract package name from tag
24+
id: package
25+
run: |
26+
TAG="${GITHUB_REF_NAME}"
27+
# @wdprlib/render@1.0.1 → @wdprlib/render
28+
PACKAGE="${TAG%@*}"
29+
echo "name=${PACKAGE}" >> "$GITHUB_OUTPUT"
30+
echo "Publishing package: ${PACKAGE}"
31+
2032
- uses: actions/checkout@v6
2133
with:
2234
fetch-depth: 0
@@ -43,25 +55,7 @@ jobs:
4355
fi
4456
done
4557
46-
- name: Publish to npm
47-
run: |
48-
# Determine npm tag from git tag (rc/alpha/beta -> rc, otherwise latest)
49-
if [[ "${{ github.ref_name }}" == *"-rc"* ]] || [[ "${{ github.ref_name }}" == *"-alpha"* ]] || [[ "${{ github.ref_name }}" == *"-beta"* ]]; then
50-
NPM_TAG="rc"
51-
else
52-
NPM_TAG="latest"
53-
fi
54-
echo "Publishing with tag: $NPM_TAG"
55-
for pkg in packages/*/; do
56-
if [ -f "$pkg/package.json" ]; then
57-
echo "Publishing $pkg"
58-
(cd "$pkg" && npm publish --provenance --access public --tag "$NPM_TAG")
59-
fi
60-
done
61-
62-
- name: Create GitHub Release
63-
uses: softprops/action-gh-release@v2
64-
with:
65-
generate_release_notes: true
58+
- name: Publish to npm (OIDC Trusted Publishing)
59+
run: npx nx release publish --projects=${{ steps.package.outputs.name }}
6660
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
NPM_CONFIG_PROVENANCE: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
2626
.eslintcache
2727
.cache
2828
*.tsbuildinfo
29+
.nx
2930

3031
# IntelliJ based IDEs
3132
.idea

0 commit comments

Comments
 (0)