|
20 | 20 | run: npm install -g yarn |
21 | 21 | - name: Install Dependencies |
22 | 22 | run: yarn |
23 | | - - name: Install conventional-changelog |
24 | | - run: npm install -g conventional-changelog-cli conventional-changelog-angular |
25 | 23 | - name: Delete Unnecessary Files on Windows |
26 | 24 | if: matrix.os == 'windows-latest' |
27 | 25 | run: | |
|
38 | 36 | if: matrix.os != 'windows-latest' |
39 | 37 | run: rm -rf README.md && rm -rf .github && rm -rf .gitignore && rm -rf .gitattributes && rm -rf .vscode && rm -rf readme && rm -rf installer && rm -rf changelog |
40 | 38 | shell: bash |
41 | | - - name: Generate changelog (Windows) |
42 | | - if: matrix.os == 'windows-latest' |
43 | | - run: | |
44 | | - # 生成 changelog |
45 | | - # 检查是否有标签 |
46 | | - $LATEST_TAG = $(git describe --tags $(git rev-list --tags --max-count=1) 2>$null) |
47 | | - Write-Output "Latest tag: $LATEST_TAG" |
48 | | - |
49 | | - # 如果没有标签,则使用所有提交 |
50 | | - if (-not $LATEST_TAG) { |
51 | | - # 为首次发布创建初始标签 |
52 | | - git config --global user.name 'GitHub Action' |
53 | | - git config --global user.email 'action@github.com' |
54 | | - git tag v0.0.0 |
55 | | - $LATEST_TAG = "v0.0.0" |
56 | | - } |
57 | | - |
58 | | - # 使用自定义脚本生成 changelog |
59 | | - node .github/generate-conventional-changelog.js |
60 | | - |
61 | | - # 复制 changelog 到输出目录(如果存在) |
62 | | - if (Test-Path "temp_changelog.md") { |
63 | | - New-Item -ItemType Directory -Force -Path "./out/" |
64 | | - Copy-Item "temp_changelog.md" -Destination "./out/changelog.md" |
65 | | - } |
66 | | - shell: pwsh |
67 | | - - name: Generate changelog (Unix) |
68 | | - if: matrix.os != 'windows-latest' |
69 | | - run: | |
70 | | - # 生成 changelog |
71 | | - # 检查是否有标签 |
72 | | - LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null) |
73 | | - echo "Latest tag: $LATEST_TAG" |
74 | | - |
75 | | - # 如果没有标签,则使用所有提交 |
76 | | - if [ -z "$LATEST_TAG" ]; then |
77 | | - # 为首次发布创建初始标签 |
78 | | - git config --global user.name 'GitHub Action' |
79 | | - git config --global user.email 'action@github.com' |
80 | | - git tag v0.0.0 |
81 | | - LATEST_TAG="v0.0.0" |
82 | | - fi |
83 | | - |
84 | | - # 使用自定义脚本生成 changelog |
85 | | - node .github/generate-conventional-changelog.js |
86 | | - |
87 | | - # 复制 changelog 到输出目录(如果存在) |
88 | | - if [ -f temp_changelog.md ]; then |
89 | | - mkdir -p ./out/ |
90 | | - cp temp_changelog.md ./out/changelog.md |
91 | | - fi |
92 | | - shell: bash |
93 | | - |
94 | 39 | - name: Build with electron-forge |
95 | 40 | run: "yarn make" |
96 | 41 | - name: Upload Build Artifacts (Windows) |
|
0 commit comments