|
| 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 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + include: |
| 23 | + - arch: x64 |
| 24 | + lib: lib64 |
| 25 | + platform: linux/amd64 |
| 26 | + - arch: ia32 |
| 27 | + lib: lib |
| 28 | + platform: linux/amd64 |
| 29 | + - arch: arm64 |
| 30 | + lib: lib64 |
| 31 | + platform: linux/arm64 |
| 32 | + - arch: arm |
| 33 | + lib: lib |
| 34 | + platform: linux/arm64 |
| 35 | + |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v3 |
| 38 | + with: |
| 39 | + repository: 'sass/dart-sass-embedded' |
| 40 | + ref: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || '' }} |
| 41 | + |
| 42 | + - name: Set up QEMU |
| 43 | + uses: docker/setup-qemu-action@v2 |
| 44 | + with: |
| 45 | + image: tonistiigi/binfmt:master # need qemu >= 7.0.0 |
| 46 | + |
| 47 | + - name: Compile Protobuf |
| 48 | + run: | |
| 49 | + docker run --rm -i \ |
| 50 | + --volume $PWD:$PWD \ |
| 51 | + --workdir $PWD \ |
| 52 | + docker.io/library/dart <<'EOF' |
| 53 | + set -e |
| 54 | + curl -fsSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 |
| 55 | + dart pub remove sass_analysis |
| 56 | + dart pub upgrade |
| 57 | + dart run grinder protobuf |
| 58 | + EOF |
| 59 | +
|
| 60 | + - name: Build |
| 61 | + run: | |
| 62 | + docker run --rm -i \ |
| 63 | + --platform ${{ matrix.platform }} \ |
| 64 | + --privileged \ |
| 65 | + --volume $PWD:$PWD \ |
| 66 | + --workdir $PWD \ |
| 67 | + ghcr.io/dart-android/dart <<'EOF' |
| 68 | + set -e |
| 69 | + export DART_SDK=/system/${{ matrix.lib }}/dart |
| 70 | + export PATH=$DART_SDK/bin:$PATH |
| 71 | + dart pub get |
| 72 | + dart run grinder pkg-standalone-android-${{ matrix.arch }} |
| 73 | + EOF |
| 74 | +
|
| 75 | + - name: Upload Artifact |
| 76 | + uses: actions/upload-artifact@v3 |
| 77 | + with: |
| 78 | + name: build-${{ matrix.arch }} |
| 79 | + path: build/*.tar.gz |
| 80 | + if-no-files-found: error |
| 81 | + |
| 82 | + release: |
| 83 | + name: Release |
| 84 | + |
| 85 | + if: github.event.repository.fork == false && startsWith(github.ref, 'refs/tags/') |
| 86 | + |
| 87 | + needs: [build] |
| 88 | + |
| 89 | + runs-on: ubuntu-latest |
| 90 | + |
| 91 | + permissions: |
| 92 | + contents: write |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Download Artifact |
| 96 | + uses: actions/download-artifact@v3 |
| 97 | + with: |
| 98 | + name: build-x64 |
| 99 | + |
| 100 | + - name: Download Artifact |
| 101 | + uses: actions/download-artifact@v3 |
| 102 | + with: |
| 103 | + name: build-ia32 |
| 104 | + |
| 105 | + - name: Download Artifact |
| 106 | + uses: actions/download-artifact@v3 |
| 107 | + with: |
| 108 | + name: build-arm64 |
| 109 | + |
| 110 | + - name: Download Artifact |
| 111 | + uses: actions/download-artifact@v3 |
| 112 | + with: |
| 113 | + name: build-arm |
| 114 | + |
| 115 | + - name: Release |
| 116 | + uses: softprops/action-gh-release@v1 |
| 117 | + with: |
| 118 | + files: | |
| 119 | + *.tar.gz |
0 commit comments