Skip to content

update

update #10

Workflow file for this run

name: NodeJS with Gulp
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Load environment
uses: GuillaumeFalourd/convert-json-to-env@v1
with:
json_file: ./config/module.config.json
- name: 生成版本代码
run: |
npm install
npm run package-ext:sothx
- name: 写入所有模块文件到发布目录
run: |
mkdir -p "$GITHUB_WORKSPACE"/GithubRelease
cd "$GITHUB_WORKSPACE"
mv $GITHUB_WORKSPACE/release/$VERSION/pad-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/fold-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/pad-magicWindow-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/pad-not-dragable-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/pad-ratioOf3To2-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/transplant-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/uninstall-fold-0.00.00.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/uninstall-pad-0.00.00.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/uninstall-pad-magicWindow-0.00.00.zip "$GITHUB_WORKSPACE"/GithubRelease
mv $GITHUB_WORKSPACE/release/$VERSION/ext/pad-ext-$VERSION.zip "$GITHUB_WORKSPACE"/GithubRelease
- name: 上传到Github Release
uses: ncipollo/release-action@main
with:
artifacts: ${{ github.workspace }}/GithubRelease/*
name: "${{ env.VERSION }}"
tag: "${{ env.VERSION }}"
bodyFile: "${{ github.workspace }}/docs/changelog.md"
allowUpdates: true
artifactErrorsFailBuild: true
makeLatest: true
- name: 更新版本链接
run: |
git config --global user.email "[email protected]"
git config --global user.name "sothx"
git add ./docs/release/*
if git commit -m "Release $VERSION"; then
git push
fi