|
8 | 8 | workflow_call:
|
9 | 9 | jobs:
|
10 | 10 | build:
|
11 |
| - strategy: |
12 |
| - matrix: |
13 |
| - include: |
14 |
| - - name : Windows x64 |
15 |
| - os: windows-2019 |
16 |
| - runtime: win-x64 |
17 |
| - - name : Windows ARM64 |
18 |
| - os: windows-2019 |
19 |
| - runtime: win-arm64 |
20 |
| - - name : macOS (Intel) |
21 |
| - os: macos-13 |
22 |
| - runtime: osx-x64 |
23 |
| - - name : macOS (Apple Silicon) |
24 |
| - os: macos-latest |
25 |
| - runtime: osx-arm64 |
26 |
| - - name : Linux |
27 |
| - os: ubuntu-20.04 |
28 |
| - runtime: linux-x64 |
29 |
| - - name : Linux (arm64) |
30 |
| - os: ubuntu-20.04 |
31 |
| - runtime: linux-arm64 |
32 |
| - name: Build ${{ matrix.name }} |
33 |
| - runs-on: ${{ matrix.os }} |
| 11 | + name: Build |
| 12 | + uses: ./.github/workflows/build.yml |
| 13 | + version: |
| 14 | + name: Prepare version string |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + version: ${{ steps.version.outputs.version }} |
34 | 18 | steps:
|
35 | 19 | - name: Checkout sources
|
36 | 20 | uses: actions/checkout@v4
|
37 |
| - - name: Setup .NET |
38 |
| - uses: actions/setup-dotnet@v4 |
39 |
| - with: |
40 |
| - dotnet-version: 8.0.x |
41 |
| - - name: Configure arm64 packages |
42 |
| - if: ${{ matrix.runtime == 'linux-arm64' }} |
43 |
| - run: | |
44 |
| - sudo dpkg --add-architecture arm64 |
45 |
| - echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted |
46 |
| - deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted |
47 |
| - deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted' \ |
48 |
| - | sudo tee /etc/apt/sources.list.d/arm64.list |
49 |
| - sudo sed -i -e 's/^deb http/deb [arch=amd64] http/g' /etc/apt/sources.list |
50 |
| - sudo sed -i -e 's/^deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list |
51 |
| - - name: Install cross-compiling dependencies |
52 |
| - if: ${{ matrix.runtime == 'linux-arm64' }} |
53 |
| - run: | |
54 |
| - sudo apt-get update |
55 |
| - sudo apt-get install clang llvm gcc-aarch64-linux-gnu zlib1g-dev:arm64 |
56 |
| - - name: Build |
57 |
| - run: dotnet build -c Release |
58 |
| - - name: Publish |
59 |
| - run: dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.runtime }} |
60 |
| - - name: Rename executable file |
61 |
| - if: ${{ startsWith(matrix.runtime, 'linux-') }} |
62 |
| - run: mv publish/SourceGit publish/sourcegit |
63 |
| - - name: Tar artifact |
64 |
| - if: ${{ startsWith(matrix.runtime, 'linux-') }} |
65 |
| - run: | |
66 |
| - tar -cvf "sourcegit.${{ matrix.runtime }}.tar" -C publish . |
67 |
| - rm -r publish/* |
68 |
| - mv "sourcegit.${{ matrix.runtime }}.tar" publish |
69 |
| - - name: Upload artifact |
70 |
| - uses: actions/upload-artifact@v4 |
71 |
| - with: |
72 |
| - name: sourcegit.${{ matrix.runtime }} |
73 |
| - path: publish |
| 21 | + - name: Output version string |
| 22 | + id: version |
| 23 | + run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT" |
| 24 | + package: |
| 25 | + needs: [build, version] |
| 26 | + name: Package |
| 27 | + uses: ./.github/workflows/package.yml |
| 28 | + with: |
| 29 | + version: ${{ needs.version.outputs.version }} |
0 commit comments