Skip to content

Commit 328b03d

Browse files
committed
ci: update github actions workflow
1 parent 77ce938 commit 328b03d

File tree

4 files changed

+76
-163
lines changed

4 files changed

+76
-163
lines changed

.github/workflows/commit.yml

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
name: Commit CI
22

3-
on:
4-
push:
5-
branches: [master]
3+
on: [push]
64

75
jobs:
8-
build-winform:
9-
runs-on: windows-latest
10-
permissions:
11-
contents: write
6+
linux:
7+
runs-on: ubuntu-latest
128
steps:
139
- uses: actions/checkout@v4
1410

@@ -18,32 +14,22 @@ jobs:
1814
dotnet-version: "8.0.x"
1915

2016
- name: Restore dependencies
21-
run: dotnet restore "./src/IME WL Converter Win"
17+
run: dotnet restore ./src/ImeWlConverterCmd
2218

2319
- name: Publish
24-
run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win"
25-
26-
- name: Archive Release
27-
run: 7z a -tzip imewlconverter_Windows.zip publish/
20+
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd
2821

29-
- uses: ncipollo/release-action@v1
22+
- name: Upload Artifact
23+
uses: actions/upload-artifact@v4
3024
with:
31-
artifacts: "imewlconverter_Windows.zip"
32-
allowUpdates: true
33-
prerelease: true
34-
commit: master
35-
tag: "preview"
36-
name: "Preview"
37-
generateReleaseNotes: true
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
40-
build-cmd:
25+
name: "imewlconverter_Linux.tar.gz"
26+
path: ./publish
27+
28+
macos:
29+
runs-on: macos-latest
4130
strategy:
4231
matrix:
43-
os: [ubuntu-latest, macos-latest]
44-
runs-on: ${{ matrix.os }}
45-
permissions:
46-
contents: write
32+
arch: [x64, arm64]
4733
steps:
4834
- uses: actions/checkout@v4
4935

@@ -56,26 +42,16 @@ jobs:
5642
run: dotnet restore ./src/ImeWlConverterCmd
5743

5844
- name: Publish
59-
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd
45+
run: dotnet publish --configuration Release --output ./publish-${{ matrix.arch }} ./src/ImeWlConverterCmd -a ${{ matrix.arch }}
6046

61-
- name: Archive Release
62-
run: tar -czf imewlconverter_${{ runner.os }}.tar.gz publish/*
63-
64-
- uses: ncipollo/release-action@v1
47+
- name: Upload Artifact
48+
uses: actions/upload-artifact@v4
6549
with:
66-
artifacts: "imewlconverter_${{ runner.os }}.tar.gz"
67-
allowUpdates: true
68-
prerelease: true
69-
commit: master
70-
tag: "preview"
71-
name: "Preview"
72-
generateReleaseNotes: true
73-
token: ${{ secrets.GITHUB_TOKEN }}
74-
75-
build-mac-arm64:
76-
runs-on: macos-latest
77-
permissions:
78-
contents: write
50+
name: "imewlconverter_macOS-${{ matrix.arch }}"
51+
path: ./publish-${{ matrix.arch }}
52+
53+
windows:
54+
runs-on: windows-latest
7955
steps:
8056
- uses: actions/checkout@v4
8157

@@ -85,21 +61,13 @@ jobs:
8561
dotnet-version: "8.0.x"
8662

8763
- name: Restore dependencies
88-
run: dotnet restore ./src/ImeWlConverterCmd
64+
run: dotnet restore "./src/IME WL Converter Win"
8965

9066
- name: Publish
91-
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd -a arm64
92-
93-
- name: Archive Release
94-
run: tar -czf imewlconverter_${{ runner.os }}-aarch64.tar.gz publish/*
67+
run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win"
9568

96-
- uses: ncipollo/release-action@v1
69+
- name: Upload Artifact
70+
uses: actions/upload-artifact@v4
9771
with:
98-
artifacts: "imewlconverter_${{ runner.os }}-aarch64.tar.gz"
99-
allowUpdates: true
100-
prerelease: true
101-
commit: master
102-
tag: "preview"
103-
name: "Preview"
104-
generateReleaseNotes: true
105-
token: ${{ secrets.GITHUB_TOKEN }}
72+
name: imewlconverter_Windows
73+
path: ./publish

.github/workflows/pull-request.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,59 @@ on:
66
- "v*"
77

88
jobs:
9-
build-winform:
10-
runs-on: windows-latest
9+
linux:
10+
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
1313

14+
- name: Generate CHANGELOG
15+
id: changelog
16+
uses: requarks/changelog-action@v1
17+
with:
18+
token: ${{ github.token }}
19+
tag: ${{ github.ref_name }}
20+
writeToFile: false
21+
includeInvalidCommits: true
22+
1423
- name: Setup .NET
1524
uses: actions/setup-dotnet@v4
1625
with:
1726
dotnet-version: "8.0.x"
1827

1928
- name: Restore dependencies
20-
run: dotnet restore "./src/IME WL Converter Win"
29+
run: dotnet restore ./src/ImeWlConverterCmd
2130

2231
- name: Publish
23-
run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win"
24-
25-
- name: Archive Release
26-
run: 7z a -tzip imewlconverter_Windows.zip publish/
32+
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd
2733

28-
- name: Update CHANGELOG
29-
id: changelog
30-
uses: requarks/changelog-action@v1
31-
with:
32-
token: ${{ github.token }}
33-
tag: ${{ github.ref_name }}
34-
writeToFile: false
35-
includeInvalidCommits: true
34+
- name: Archive
35+
run: tar -czf imewlconverter_Linux.tar.gz publish/*
3636

3737
- uses: ncipollo/release-action@v1
3838
with:
39-
artifacts: "imewlconverter_Windows.zip"
39+
artifacts: "imewlconverter_Linux.tar.gz"
4040
allowUpdates: true
4141
body: |
4242
${{ steps.changelog.outputs.changes }}
4343
token: ${{ secrets.GITHUB_TOKEN }}
4444

45-
build-cmd:
45+
macos:
46+
runs-on: macos-latest
4647
strategy:
4748
matrix:
48-
os: [ubuntu-latest, macos-latest]
49-
runs-on: ${{ matrix.os }}
49+
arch: [x64, arm64]
5050
steps:
5151
- uses: actions/checkout@v4
5252

53+
- name: Generate CHANGELOG
54+
id: changelog
55+
uses: requarks/changelog-action@v1
56+
with:
57+
token: ${{ github.token }}
58+
tag: ${{ github.ref_name }}
59+
writeToFile: false
60+
includeInvalidCommits: true
61+
5362
- name: Setup .NET
5463
uses: actions/setup-dotnet@v4
5564
with:
@@ -59,59 +68,50 @@ jobs:
5968
run: dotnet restore ./src/ImeWlConverterCmd
6069

6170
- name: Publish
62-
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd
63-
64-
- name: Archive Release
65-
run: tar -czf imewlconverter_${{ runner.os }}.tar.gz publish/*
71+
run: dotnet publish --configuration Release --output ./publish-${{ matrix.arch }} ./src/ImeWlConverterCmd -a ${{ matrix.arch }}
6672

67-
- name: Update CHANGELOG
68-
id: changelog
69-
uses: requarks/changelog-action@v1
70-
with:
71-
token: ${{ github.token }}
72-
tag: ${{ github.ref_name }}
73-
writeToFile: false
74-
includeInvalidCommits: true
73+
- name: Archive
74+
run: tar -czf imewlconverter_macOS-${{ matrix.arch }}.tar.gz publish-${{ matrix.arch }}/*
7575

7676
- uses: ncipollo/release-action@v1
7777
with:
78-
artifacts: "imewlconverter_${{ runner.os }}.tar.gz"
78+
artifacts: "imewlconverter_macOS-${{ matrix.arch }}.tar.gz"
7979
allowUpdates: true
8080
body: |
8181
${{ steps.changelog.outputs.changes }}
8282
token: ${{ secrets.GITHUB_TOKEN }}
8383

84-
build-mac-arm64:
85-
runs-on: macos-latest
84+
windows:
85+
runs-on: windows-latest
8686
steps:
8787
- uses: actions/checkout@v4
8888

89+
- name: Generate CHANGELOG
90+
id: changelog
91+
uses: requarks/changelog-action@v1
92+
with:
93+
token: ${{ github.token }}
94+
tag: ${{ github.ref_name }}
95+
writeToFile: false
96+
includeInvalidCommits: true
97+
8998
- name: Setup .NET
9099
uses: actions/setup-dotnet@v4
91100
with:
92101
dotnet-version: "8.0.x"
93102

94103
- name: Restore dependencies
95-
run: dotnet restore ./src/ImeWlConverterCmd
104+
run: dotnet restore "./src/IME WL Converter Win"
96105

97106
- name: Publish
98-
run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd -a arm64
99-
100-
- name: Archive Release
101-
run: tar -czf imewlconverter_${{ runner.os }}-aarch64.tar.gz publish/*
107+
run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win"
102108

103-
- name: Update CHANGELOG
104-
id: changelog
105-
uses: requarks/changelog-action@v1
106-
with:
107-
token: ${{ github.token }}
108-
tag: ${{ github.ref_name }}
109-
writeToFile: false
110-
includeInvalidCommits: true
109+
- name: Archive
110+
run: 7z a -tzip imewlconverter_Windows.zip publish/
111111

112112
- uses: ncipollo/release-action@v1
113113
with:
114-
artifacts: "imewlconverter_${{ runner.os }}-aarch64.tar.gz"
114+
artifacts: "imewlconverter_Windows.zip"
115115
allowUpdates: true
116116
body: |
117117
${{ steps.changelog.outputs.changes }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 深蓝词库转换
44

55
[![Stars](https://img.shields.io/github/stars/studyzy/imewlconverter)](https://github.com/studyzy/imewlconverter/stargazers)
6-
![Actions Check](https://github.com/studyzy/imewlconverter/actions/workflows/winform.yml/badge.svg)
6+
![Actions Check](https://github.com/studyzy/imewlconverter/actions/workflows/commit.yml/badge.svg)
77
![License](https://img.shields.io/github/license/studyzy/imewlconverter)
88
![Repo size](https://img.shields.io/github/repo-size/studyzy/imewlconverter)
99
[![Code Count](https://tokei.rs/b1/github/studyzy/imewlconverter)](https://github.com/studyzy/imewlconverter)

0 commit comments

Comments
 (0)