Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed May 24, 2024
1 parent 1585094 commit 7d1ffc9
Showing 1 changed file with 52 additions and 13 deletions.
65 changes: 52 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,49 @@ on:
default: main

jobs:
archive:
runs-on: ubuntu-latest

container:
image: docker.io/library/debian

strategy:
fail-fast: false
matrix:
include:
- host-arch: x64

steps:
- name: Install build tools
run: |
apt-get update
apt-get install --no-install-recommends -y ca-certificates curl git python3
- name: Fetch Dart SDK
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export DEPOT_TOOLS_UPDATE=0 PATH=$PWD/depot_tools:$PATH
mkdir dart-sdk
cd dart-sdk
gclient config --name sdk https://dart.googlesource.com/sdk.git@${{ inputs.ref }}
gclient sync --no-history
- name: Archive
run: |
tar -czf dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz dart-sdk
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dart-${{ inputs.ref }}-${{ matrix.host-arch }}
path: dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz
if-no-files-found: error
compression-level: 0

build:
needs: [archive]

runs-on: ubuntu-latest

container:
Expand All @@ -38,10 +80,19 @@ jobs:
target-arch: riscv64

steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: dart-${{ inputs.ref }}-${{ matrix.host-arch }}

- name: Unarchive
run: |
tar -xzf dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz
- name: Install build tools
run: |
apt-get update
apt-get install --no-install-recommends -y ca-certificates curl git python3 xz-utils
apt-get install --no-install-recommends -y ca-certificates curl git python3
- name: Setup multiarch
run: |
Expand All @@ -58,18 +109,6 @@ jobs:
;;
esac
- name: Fetch Dart SDK
id: fetch
run: |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export DEPOT_TOOLS_UPDATE=0 PATH=$PWD/depot_tools:$PATH
mkdir dart-sdk
cd dart-sdk
gclient config --name sdk https://dart.googlesource.com/sdk.git@${{ inputs.ref }}
echo "target_os = ['android']" | tee -a .gclient
gclient sync --no-history
- name: Build
run: |
cd dart-sdk/sdk
Expand Down

0 comments on commit 7d1ffc9

Please sign in to comment.