This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (105 loc) · 3.09 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: build
on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: x64
platform: linux/amd64
- arch: ia32
platform: linux/386
- arch: arm64
platform: linux/arm64
- arch: arm
platform: linux/arm/v7
steps:
- uses: actions/checkout@v4
with:
repository: 'sass/dart-sass'
ref: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || '' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Compile Protobuf
run: |
docker run --rm -i \
--volume $PWD:$PWD \
--workdir $PWD \
docker.io/library/dart <<'EOF'
set -e
curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1
dart pub get
dart run grinder protobuf
EOF
- name: Build
run: |
docker run --rm -i \
--platform ${{ matrix.arch == 'arm' && 'linux/amd64' || matrix.platform }} \
--volume $PWD:$PWD \
--workdir $PWD \
ghcr.io/dart-musl/dart <<'EOF'
set -e
dart pub get
dart run grinder pkg-standalone-linux-${{ matrix.arch }}
EOF
- name: Fix Dart Runtime
if: matrix.arch == 'arm'
run: |
docker run --rm -i \
--platform ${{ matrix.platform }} \
--volume $PWD:$PWD \
--workdir $PWD \
ghcr.io/dart-musl/dart <<'EOF'
set -e
apk add --no-cache tar
cd build
DART_RUNTIME=$(tar -tzf *.tar.gz --wildcards "*/src/dart")
tar -xzf *.tar.gz
cp $DART_SDK/bin/dart $DART_RUNTIME
tar -czf *.tar.gz "$(dirname "$(dirname "$DART_RUNTIME")")"
EOF
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.arch }}
path: build/*.tar.gz
if-no-files-found: error
release:
name: Release
if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-x64
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-ia32
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-arm64
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-arm
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
*.tar.gz