diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml new file mode 100644 index 0000000000..00ef81fa6b --- /dev/null +++ b/.github/workflows/test-npm.yml @@ -0,0 +1,29 @@ +name: Publish Package via OIDC + +on: + workflow_dispatch: # 手动触发 + +permissions: + id-token: write + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - name: Ensure latest npm + run: npm install -g npm@latest + + - name: Publish to npm (OIDC) + working-directory: ./test-npm + run: npm publish diff --git a/test-npm/index.js b/test-npm/index.js new file mode 100644 index 0000000000..4b2e66372c --- /dev/null +++ b/test-npm/index.js @@ -0,0 +1 @@ +console.log('test') diff --git a/test-npm/package-lock.json b/test-npm/package-lock.json new file mode 100644 index 0000000000..7b5c559e3d --- /dev/null +++ b/test-npm/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "@element-plus/nightly", + "version": "0.0.2025092801", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@element-plus/nightly", + "version": "0.0.2025092801", + "license": "ISC" + } + } +} diff --git a/test-npm/package.json b/test-npm/package.json new file mode 100644 index 0000000000..45b7d03440 --- /dev/null +++ b/test-npm/package.json @@ -0,0 +1,11 @@ +{ + "name": "@element-plus/nightly", + "version": "0.0.2025092801", + "description": "test", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" +}