-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.05 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build
on:
push:
pull_request:
merge_group:
types: [checks_requested]
# allow manual triggering
workflow_dispatch:
jobs:
build:
name: Build .NET for LoongArch64
runs-on: loongson-community-runners # ubuntu-latest is too small for the build to finish in 6hr
outputs:
run_id: ${{ github.run_id }}
container:
image: ghcr.io/loongson-community/dotnet-unofficial-build-builder:20240918T124748Z
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
BUILD_CONFIG: _config.ci.sh
CCACHE_DIR: /tmp/ccache
ROOTFS_DIR: /tmp/rootfs
OUT_DIR: /tmp/out
steps:
- name: Check out myself
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: "ghcr.io/loongson-community/binfmt:qemu-v9.0.2-loong.20240919"
platforms: loong64
- name: Cache C/C++ objects
uses: actions/cache@v4
with:
key: ${{ runner.os }}-dotnet9-r1
path: |
/tmp/ccache
- name: Run the build
run: ./build.sh
- name: Finalize output
run: ./finalize-output.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-out
path: /tmp/out/
compression-level: 0 # all artifacts are already compressed
release:
name: Make a GitHub Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs:
- build
steps:
- name: Checkout myself
uses: actions/checkout@v4
- name: Download artifacts for release
uses: actions/download-artifact@v4
with:
run-id: ${{ needs.build.outputs.run_id }}
path: tmp/release
- name: Make the release
uses: softprops/action-gh-release@v2
with:
files: tmp/release/*
generate_release_notes: false
prerelease: false # treat upstream preview releases as non-prerelease too