Skip to content

Merge branch 'main' of https://github.com/CandriaJS/core-lib #115

Merge branch 'main' of https://github.com/CandriaJS/core-lib

Merge branch 'main' of https://github.com/CandriaJS/core-lib #115

Workflow file for this run

name: 发布发行版
on:
push:
branches:
- main
permissions:
contents: read
id-token: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
core-lib_rerelease: ${{ steps.release-please.outputs['packages/core-lib--release_created'] }}
axios_rerelease: ${{ steps.release-please.outputs['packages/axios--release_created'] }}
form-data_rerelease: ${{
steps.release-please.outputs['packages/form-data--release_created'] }}
exec_rerelease: ${{ steps.release-please.outputs['packages/exec--release_created'] }}
lodash_rerelease: ${{ steps.release-please.outputs['packages/lodash--release_created'] }}
simple-git_rerelease: ${{
steps.release-please.outputs['packages/simple-git--release_created'] }}
dotenv_rerelease: ${{ steps.release-please.outputs['packages/dotenv--release_created'] }}
log4js_rerelease: ${{ steps.release-please.outputs['packages/log4js--release_created'] }}
sqlite3_rerelease: ${{ steps.release-please.outputs['packages/sqlite3--release_created'] }}
steps:
- name: 获取token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: 获取用户ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug
}}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: 运行 release-please-action
id: release-please
uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
publish-axios:
needs: release
if: ${{ needs.release.outputs.axios_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: |
- args: [--no-frozen-lockfile]
- name: 构建
run: |
pnpm build
mkdir -p ${{ runner.temp }}/temp/axios
cp -r package.json README.md dist ${{ runner.temp }}/temp/axios
working-directory: packages/axios
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: axios
path: ${{ runner.temp }}/temp/axios
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/axios
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/axios
access: public
provenance: true
publish-form-data:
needs: release
if: ${{ needs.release.outputs.form-data_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/form-data
cp -r package.json README.md dist ${{ runner.temp }}/temp/form-data
working-directory: packages/form-data
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: form-data
path: ${{ runner.temp }}/temp/form-data
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/form-data
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/form-data
access: public
provenance: true
publish-exec:
needs: release
if: ${{ needs.release.outputs.exec_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/exec
cp -r package.json README.md dist ${{ runner.temp }}/temp/exec
working-directory: packages/exec
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: exec
path: ${{ runner.temp }}/temp/exec
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/exec/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/exec
access: public
provenance: true
publish-lodash:
needs: release
if: ${{ needs.release.outputs.lodash_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/lodash
cp -r package.json README.md dist ${{ runner.temp }}/temp/lodash
working-directory: packages/lodash
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: lodash
path: ${{ runner.temp }}/temp/lodash
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/lodash/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/lodash
access: public
provenance: true
publish-simple-git:
needs: release
if: ${{ needs.release.outputs.simple-git_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/simple-git
cp -r package.json README.md dist ${{ runner.temp }}/temp/simple-git
working-directory: packages/simple-git
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: simple-git
path: ${{ runner.temp }}/temp/simple-git
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/simple-git/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/simple-git
access: public
provenance: true
publish-dotenv:
needs: release
if: ${{ needs.release.outputs.dotenv_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/dotenv
cp -r package.json README.md dist ${{ runner.temp }}/temp/dotenv
working-directory: packages/dotenv
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: dotenv
path: ${{ runner.temp }}/temp/dotenv
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/dotenv/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/dotenv
access: public
provenance: true
publish-log4js:
needs: release
if: ${{ needs.release.outputs.log4js_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/log4js
cp -r package.json README.md dist ${{ runner.temp }}/temp/log4js
working-directory: packages/log4js
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: log4js
path: ${{ runner.temp }}/temp/log4js
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/log4js/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/log4js
access: public
provenance: true
publish-sqlite3:
needs: release
if: ${{ needs.release.outputs.sqlite3_rerelease == 'true' }}
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.4
run_install: "- args: [--no-frozen-lockfile]"
- name: 构建
run: |-
pnpm build
mkdir -p ${{ runner.temp }}/temp/sqlite3
cp -r package.json README.md dist ${{ runner.temp }}/temp/sqlite3
working-directory: packages/sqlite3
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: sqlite3
path: ${{ runner.temp }}/temp/sqlite3
- name: 发布到 GitHub Packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com
package: packages/sqlite3/package.json
- name: 发布到 NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
registry: https://registry.npmjs.org/
package: packages/sqlite3
access: public
provenance: true