Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Update build.yml

Update build.yml #63

Workflow file for this run

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/amd64
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 }}-musl
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@v4
with:
name: build-x64
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: build-ia32
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: build-arm64
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: build-arm
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
*.tar.gz