Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit 7f9f529

Browse files
committed
Update build.yml
1 parent ed31e82 commit 7f9f529

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,20 @@ jobs:
2020
matrix:
2121
include:
2222
- arch: x64
23-
builds-on: linux/amd64
24-
runs-on: linux/amd64
23+
platform: linux/amd64
2524
- arch: ia32
26-
builds-on: linux/386
27-
runs-on: linux/386
25+
platform: linux/386
2826
- arch: arm64
29-
builds-on: linux/arm64
30-
runs-on: linux/arm64
27+
platform: linux/arm64
3128
- arch: arm
32-
builds-on: linux/amd64
33-
runs-on: linux/arm/v7
29+
platform: linux/arm/v7
3430

3531
steps:
3632
- uses: actions/checkout@v3
3733
with:
3834
repository: 'sass/dart-sass-embedded'
3935
ref: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || '' }}
4036

41-
- name: Configure
42-
id: configure
43-
run: |
44-
NAME=${NAME:-$(yq .name pubspec.yaml)}
45-
VERSION=${VERSION:-$(yq .version pubspec.yaml)}
46-
ARCHIVE=$NAME-$VERSION-linux-${{ matrix.arch }}.tar.gz
47-
echo "name=$NAME" | tee -a $GITHUB_OUTPUT
48-
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
49-
echo "archive=$ARCHIVE" | tee -a $GITHUB_OUTPUT
50-
5137
- name: Set up QEMU
5238
uses: docker/setup-qemu-action@v2
5339

@@ -66,7 +52,7 @@ jobs:
6652
- name: Build
6753
run: |
6854
docker run --rm -i \
69-
--platform ${{ matrix.builds-on }} \
55+
--platform ${{ matrix.arch == 'arm' && 'linux/amd64' || matrix.platform }} \
7056
--volume $PWD:$PWD \
7157
--workdir $PWD \
7258
ghcr.io/dart-musl/dart <<'EOF'
@@ -76,25 +62,27 @@ jobs:
7662
EOF
7763
7864
- name: Fix Dart Runtime
79-
if: matrix.builds-on != matrix.runs-on
65+
if: matrix.arch == 'arm'
8066
run: |
8167
docker run --rm -i \
82-
--platform ${{ matrix.runs-on }} \
68+
--platform ${{ matrix.platform }} \
8369
--volume $PWD:$PWD \
8470
--workdir $PWD \
8571
ghcr.io/dart-musl/dart <<'EOF'
8672
set -e
73+
apk add --no-cache tar
8774
cd build
88-
tar -xzf ${{ steps.configure.outputs.archive }}
89-
cp $DART_SDK/bin/dart ${{ steps.configure.outputs.name }}/src/dart
90-
tar -czf ${{ steps.configure.outputs.archive }} ${{ steps.configure.outputs.name }}
75+
DART_RUNTIME=$(tar -tzf *.tar.gz --wildcards "*/src/dart")
76+
tar -xzf *.tar.gz
77+
cp $DART_SDK/bin/dart $DART_RUNTIME
78+
tar -czf *.tar.gz "$(dirname "$(dirname "$DART_RUNTIME")")"
9179
EOF
9280
9381
- name: Upload Artifact
9482
uses: actions/upload-artifact@v3
9583
with:
9684
name: build-${{ matrix.arch }}
97-
path: build/${{ steps.configure.outputs.archive }}
85+
path: build/*.tar.gz
9886
if-no-files-found: error
9987

10088
release:

0 commit comments

Comments
 (0)