diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml new file mode 100644 index 00000000..c3b9658a --- /dev/null +++ b/.github/workflows/commit.yml @@ -0,0 +1,123 @@ +name: Commit CI + +on: + push: + branches: [master] + +jobs: + build-winform: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore dependencies + run: dotnet restore "./src/IME WL Converter Win" + + - name: Publish + run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win" + + - name: Archive Release + run: 7z a -tzip imewlconverter_Windows.zip publish/ + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + writeToFile: false + includeInvalidCommits: true + + - uses: ncipollo/release-action@v1 + with: + artifacts: "imewlconverter_Windows.zip" + allowUpdates: true + prerelease: true + tag: "canary" + body: | + ${{ steps.changelog.outputs.changes }} + token: ${{ secrets.GITHUB_TOKEN }} + + build-cmd: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore dependencies + run: dotnet restore ./src/ImeWlConverterCmd + + - name: Publish + run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd + + - name: Archive Release + run: tar -czf imewlconverter_${{ runner.os }}.tar.gz publish/* + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + writeToFile: false + includeInvalidCommits: true + + - uses: ncipollo/release-action@v1 + with: + artifacts: "imewlconverter_${{ runner.os }}.tar.gz" + allowUpdates: true + prerelease: true + tag: "canary" + body: | + ${{ steps.changelog.outputs.changes }} + token: ${{ secrets.GITHUB_TOKEN }} + + build-mac-arm64: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore dependencies + run: dotnet restore ./src/ImeWlConverterCmd + + - name: Publish + run: dotnet publish --configuration Release --output ./publish ./src/ImeWlConverterCmd -a arm64 + + - name: Archive Release + run: tar -czf imewlconverter_${{ runner.os }}-aarch64.tar.gz publish/* + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + writeToFile: false + includeInvalidCommits: true + + - uses: ncipollo/release-action@v1 + with: + artifacts: "imewlconverter_${{ runner.os }}-aarch64.tar.gz" + allowUpdates: true + prerelease: true + tag: "canary" + body: | + ${{ steps.changelog.outputs.changes }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dotnet.yml b/.github/workflows/pull-request.yml similarity index 57% rename from .github/workflows/dotnet.yml rename to .github/workflows/pull-request.yml index 13249efd..633e29a8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/pull-request.yml @@ -1,13 +1,33 @@ -name: .NET +name: Pull Request CI on: - push: - branches: [master] pull_request: branches: [master] jobs: - build: + build-winform: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore dependencies + run: dotnet restore "./src/IME WL Converter Win" + + - name: Publish + run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win" + + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: WinFormApp + path: ./publish + + build-cmd: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/winform.yml b/.github/workflows/winform.yml deleted file mode 100644 index ab7c5074..00000000 --- a/.github/workflows/winform.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: .NET WinForm - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "8.0.x" - - - name: Restore dependencies - run: dotnet restore "./src/IME WL Converter Win" - - - name: Publish - run: dotnet publish --configuration Release --output ./publish "./src/IME WL Converter Win" - - - name: Archive artifacts - uses: actions/upload-artifact@v4 - with: - name: WinFormApp - path: ./publish