Skip to content

Commit

Permalink
ci: add preview build
Browse files Browse the repository at this point in the history
  • Loading branch information
nopdan committed Jul 21, 2024
1 parent 5cb5704 commit a3ac115
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 34 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Commit CI

on:
push:
branches: [master]

jobs:
build-winform:
runs-on: windows-latest
permissions:
contents: write
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/

- uses: ncipollo/release-action@v1
with:
artifacts: "imewlconverter_Windows.zip"
allowUpdates: true
prerelease: true
commit: master
tag: "preview"
name: "Preview"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}

build-cmd:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: write
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/*

- uses: ncipollo/release-action@v1
with:
artifacts: "imewlconverter_Windows.zip"
allowUpdates: true
prerelease: true
commit: master
tag: "preview"
name: "Preview"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}

build-mac-arm64:
runs-on: macos-latest
permissions:
contents: write
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/*

- uses: ncipollo/release-action@v1
with:
artifacts: "imewlconverter_Windows.zip"
allowUpdates: true
prerelease: true
commit: master
tag: "preview"
name: "Preview"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/winform.yml

This file was deleted.

0 comments on commit a3ac115

Please sign in to comment.