-
Notifications
You must be signed in to change notification settings - Fork 370
Upload releases for musl-libc and android #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
91857bc
Upload releases for musl-libc and android
ntkme c619b7f
Update to artifact@v4
ntkme 2105928
Add token to github calls
ntkme f51216e
Split CI.yml into multiple files
ntkme 7e8dbf0
Check github.event.repository.fork == false
ntkme d172ec7
Add missing permission
ntkme 5617582
Add missing tokens
ntkme afdca55
Rename test-framework to test-vendor
ntkme 0e35471
Update CI job name
ntkme ad9bb54
Move a comment
ntkme 0153af2
Correct artifact pattern
ntkme 9a789e5
Use lts/* and lts/-n syntax for node version
ntkme 9463b38
Reorder
ntkme 502892f
Use lts/* everywhere
ntkme 9418931
Fix os label
ntkme 9544064
Apply suggestions from code review
ntkme e21b24a
Update comments
ntkme ea053e7
Add a CHANGELOG entry
nex3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Build for android | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x64 | ||
| lib: lib64 | ||
| platform: linux/amd64 | ||
| - arch: ia32 | ||
| lib: lib | ||
| platform: linux/amd64 | ||
| - arch: arm64 | ||
| lib: lib64 | ||
| platform: linux/arm64 | ||
| - arch: arm | ||
| lib: lib | ||
| platform: linux/arm64 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| with: | ||
| image: tonistiigi/binfmt:master # need qemu >= 7.0.0 | ||
|
|
||
| - name: Compile Protobuf | ||
| run: | | ||
| docker run --rm -i \ | ||
| --volume "$PWD:$PWD" \ | ||
| --workdir "$PWD" \ | ||
| docker.io/library/dart <<'EOF' | ||
| set -e | ||
| curl -fsSL -H "Authorization: Bearer ${{ github.token }}" "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.platform }} \ | ||
| --privileged \ | ||
| --volume "$PWD:$PWD" \ | ||
| --workdir "$PWD" \ | ||
| ghcr.io/dart-android/dart <<'EOF' | ||
| set -e | ||
| export DART_SDK=/system/${{ matrix.lib }}/dart | ||
| export PATH=$DART_SDK/bin:$PATH | ||
| dart pub get | ||
| dart run grinder pkg-standalone-android-${{ matrix.arch }} | ||
| EOF | ||
|
|
||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-android-${{ matrix.arch }} | ||
| path: build/*.tar.gz | ||
| if-no-files-found: error | ||
| compression-level: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Build for linux-musl | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x64 | ||
| platform: linux/amd64 | ||
| - arch: ia32 | ||
| platform: linux/386 | ||
| - arch: arm64 | ||
| platform: linux/arm64 | ||
| - arch: arm | ||
| platform: linux/arm/v7 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - 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 -H "Authorization: Bearer ${{ github.token }}" "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 | ||
|
|
||
| # https://gitlab.com/qemu-project/qemu/-/issues/1729 | ||
| # | ||
| # There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm. | ||
| # Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot | ||
| # for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead. | ||
| - 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 }} | ||
| # Rename the artifact from -linux- to -linux-musl- to avoid conflict with glibc builds. | ||
| find build -name '*.tar.gz' -print0 | xargs -0 -n 1 -- sh -xc 'mv "$1" "$(echo "$1" | sed -e "s/linux/linux-musl/")"' -- | ||
| EOF | ||
|
|
||
| # The kernel snapshot created for arm in the previous step is bundling a glibc based dart runtime | ||
| # due to how cli_pkg downloads the sdk for building non-native platforms. Therefore we need to | ||
| # replace it with musl-libc based dart runtime to create a working linux-musl-arm package. | ||
| - name: Fix Dart Runtime | ||
| if: matrix.arch == 'arm' | ||
| run: | | ||
| docker run --rm -i \ | ||
| --platform ${{ matrix.platform }} \ | ||
| --volume $PWD:$PWD \ | ||
| --workdir $PWD \ | ||
| ghcr.io/dart-musl/dart <<'EOF' | ||
| set -e | ||
| apk add --no-cache tar | ||
| cd build | ||
| DART_RUNTIME=$(tar -tzf *.tar.gz --wildcards "*/src/dart") | ||
| tar -xzf *.tar.gz | ||
| cp $DART_SDK/bin/dart $DART_RUNTIME | ||
| tar -czf *.tar.gz "$(dirname "$(dirname "$DART_RUNTIME")")" | ||
| EOF | ||
|
|
||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-linux-musl-${{ matrix.arch }} | ||
| path: build/*.tar.gz | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Build for linux | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x64 | ||
| platform: linux/amd64 | ||
| - arch: ia32 | ||
| platform: linux/amd64 | ||
| - arch: arm | ||
| platform: linux/arm/v7 | ||
| - arch: arm64 | ||
| platform: linux/arm64 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - 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 -H "Authorization: Bearer ${{ github.token }}" "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.platform }} \ | ||
| --volume "$PWD:$PWD" \ | ||
| --workdir "$PWD" \ | ||
| docker.io/library/dart:latest <<'EOF' | ||
| set -e | ||
| dart pub get | ||
| dart run grinder pkg-standalone-linux-${{ matrix.arch }} | ||
| EOF | ||
|
|
||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-linux-${{ matrix.arch }} | ||
| path: build/*.tar.gz | ||
| if-no-files-found: error | ||
| compression-level: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Build for macos | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: ${{ matrix.runner }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x64 | ||
| runner: macos-latest | ||
| # https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/ | ||
| - arch: arm64 | ||
| runner: macos-latest-xlarge | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/util/initialize | ||
| with: {github-token: "${{ github.token }}"} | ||
|
|
||
| - name: Build | ||
| run: dart run grinder pkg-standalone-macos-${{ matrix.arch }} | ||
|
|
||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-macos-${{ matrix.arch }} | ||
| path: build/*.tar.gz | ||
| if-no-files-found: error | ||
| compression-level: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Build for windows | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: ${{ matrix.runner }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - arch: x64 | ||
| runner: windows-latest | ||
| - arch: ia32 | ||
| runner: windows-latest | ||
| # The support of windows-arm64 dart-sdk is in beta. | ||
| # TODO: Enable this once windows-arm64 support is stable. | ||
| # - arch: arm64 | ||
| # runner: windows-latest | ||
ntkme marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/util/initialize | ||
| with: {github-token: "${{ github.token }}"} | ||
|
|
||
| - name: Build | ||
| run: dart run grinder pkg-standalone-windows-${{ matrix.arch }} | ||
|
|
||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-windows-${{ matrix.arch }} | ||
| path: build/*.zip | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.