Skip to content

Commit

Permalink
ci: Cross-compiling on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nopdan committed Oct 12, 2024
1 parent 328b03d commit 92731d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: "imewlconverter_Linux.tar.gz"
name: "imewlconverter_Linux"
path: ./publish

macos:
runs-on: macos-latest
strategy:
matrix:
arch: [x64, arm64]
steps:
- uses: actions/checkout@v4

Expand All @@ -42,13 +39,21 @@ jobs:
run: dotnet restore ./src/ImeWlConverterCmd

- name: Publish
run: dotnet publish --configuration Release --output ./publish-${{ matrix.arch }} ./src/ImeWlConverterCmd -a ${{ matrix.arch }}
run: |
dotnet publish --configuration Release --output ./publish-x64 ./src/ImeWlConverterCmd -a x64
dotnet publish --configuration Release --output ./publish-arm64 ./src/ImeWlConverterCmd -a arm64
- name: Upload Artifact
- name: Upload Artifact (x64)
uses: actions/upload-artifact@v4
with:
name: "imewlconverter_macOS-x64"
path: ./publish-x64

- name: Upload Artifact (arm64)
uses: actions/upload-artifact@v4
with:
name: "imewlconverter_macOS-${{ matrix.arch }}"
path: ./publish-${{ matrix.arch }}
name: "imewlconverter_macOS-arm64"
path: ./publish-arm64

windows:
runs-on: windows-latest
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ jobs:

macos:
runs-on: macos-latest
strategy:
matrix:
arch: [x64, arm64]
steps:
- uses: actions/checkout@v4

Expand All @@ -68,14 +65,18 @@ jobs:
run: dotnet restore ./src/ImeWlConverterCmd

- name: Publish
run: dotnet publish --configuration Release --output ./publish-${{ matrix.arch }} ./src/ImeWlConverterCmd -a ${{ matrix.arch }}
run: |
dotnet publish --configuration Release --output ./publish-x64 ./src/ImeWlConverterCmd -a x64
dotnet publish --configuration Release --output ./publish-arm64 ./src/ImeWlConverterCmd -a arm64
- name: Archive
run: tar -czf imewlconverter_macOS-${{ matrix.arch }}.tar.gz publish-${{ matrix.arch }}/*
run: |
tar -czf imewlconverter_macOS-x64.tar.gz publish-x64/*
tar -czf imewlconverter_macOS-arm64.tar.gz publish-arm64/*
- uses: ncipollo/release-action@v1
with:
artifacts: "imewlconverter_macOS-${{ matrix.arch }}.tar.gz"
artifacts: "imewlconverter_macOS-x64.tar.gz,imewlconverter_macOS-arm64.tar.gz"
allowUpdates: true
body: |
${{ steps.changelog.outputs.changes }}
Expand Down

0 comments on commit 92731d0

Please sign in to comment.