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

Commit fe1eeb2

Browse files
committed
Initial commit
0 parents  commit fe1eeb2

File tree

4 files changed

+166
-0
lines changed

4 files changed

+166
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/build.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '**'
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
jobs:
14+
build:
15+
name: Build
16+
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
include:
22+
- arch: x64
23+
builds-on: linux/amd64
24+
runs-on: linux/amd64
25+
- arch: ia32
26+
builds-on: linux/amd64
27+
runs-on: linux/386
28+
- arch: arm64
29+
builds-on: linux/arm64
30+
runs-on: linux/arm64
31+
- arch: arm
32+
builds-on: linux/amd64
33+
runs-on: linux/arm/v7
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
repository: 'sass/dart-sass-embedded'
39+
ref: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || '' }}
40+
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+
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v2
53+
54+
- name: Compile Protobuf
55+
run: |
56+
docker run --rm -i \
57+
--volume $PWD:$PWD \
58+
--workdir $PWD \
59+
docker.io/library/dart <<'EOF'
60+
set -e
61+
apt-get update
62+
apt-get install -y protobuf-compiler
63+
dart pub get
64+
dart run grinder protobuf
65+
EOF
66+
67+
- name: Build
68+
run: |
69+
docker run --rm -i \
70+
--platform ${{ matrix.builds-on }} \
71+
--volume $PWD:$PWD \
72+
--workdir $PWD \
73+
ghcr.io/dart-musl/dart <<'EOF'
74+
set -e
75+
dart pub get
76+
dart run grinder pkg-standalone-linux-${{ matrix.arch }}
77+
EOF
78+
79+
- name: Fix Dart Runtime
80+
if: matrix.builds-on != matrix.runs-on
81+
run: |
82+
docker run --rm -i \
83+
--platform ${{ matrix.runs-on }} \
84+
--volume $PWD:$PWD \
85+
--workdir $PWD \
86+
ghcr.io/dart-musl/dart <<'EOF'
87+
set -e
88+
cd build
89+
tar -xzf ${{ steps.configure.outputs.archive }}
90+
cp $DART_SDK/bin/dart ${{ steps.configure.outputs.name }}/src/dart
91+
tar -czf ${{ steps.configure.outputs.archive }} ${{ steps.configure.outputs.name }}
92+
EOF
93+
94+
- name: Upload Artifact
95+
uses: actions/upload-artifact@v3
96+
with:
97+
name: build-${{ matrix.arch }}
98+
path: build/${{ steps.configure.outputs.archive }}
99+
if-no-files-found: error
100+
101+
release:
102+
name: Release
103+
104+
if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/')
105+
106+
needs: [build]
107+
108+
runs-on: ubuntu-latest
109+
110+
permissions:
111+
contents: write
112+
113+
steps:
114+
- name: Download Artifact
115+
uses: actions/download-artifact@v3
116+
with:
117+
name: build-x64
118+
119+
- name: Download Artifact
120+
uses: actions/download-artifact@v3
121+
with:
122+
name: build-ia32
123+
124+
- name: Download Artifact
125+
uses: actions/download-artifact@v3
126+
with:
127+
name: build-arm64
128+
129+
- name: Download Artifact
130+
uses: actions/download-artifact@v3
131+
with:
132+
name: build-arm
133+
134+
- name: Release
135+
uses: softprops/action-gh-release@v1
136+
with:
137+
files: |
138+
*.tar.gz

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Dart for musl (unofficial)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# dart-sass-embedded

0 commit comments

Comments
 (0)