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

Deploy linux arm64 release to github #77

Merged
merged 4 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 44 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}

- run: dart pub get
- run: dart pub run grinder protobuf
- run: dart run grinder protobuf
env: {UPDATE_SASS_PROTOCOL: false}
- run: dart pub run grinder pkg-standalone-dev
- run: dart run grinder pkg-standalone-dev
- name: Run tests
run: dart pub run test -r expanded
run: dart run test -r expanded

static_analysis:
name: Static analysis
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}

- run: dart pub get
- run: dart pub run grinder protobuf
- run: dart run grinder protobuf
env: {UPDATE_SASS_PROTOCOL: false}
- name: Analyze dart
run: dart analyze --fatal-warnings ./
Expand All @@ -117,9 +117,42 @@ jobs:
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart pub run grinder protobuf
- run: dart run grinder protobuf
- name: Deploy
run: dart pub run grinder pkg-github-release pkg-github-linux
run: dart run grinder pkg-github-release pkg-github-linux-ia32 pkg-github-linux-x64
env: {GH_BEARER_TOKEN: "${{ github.token }}"}

deploy_github_linux_qemu:
name: "Deploy Github: Linux"
runs-on: ubuntu-latest
strategy:
matrix:
include:
# https://github.com/dart-lang/sdk/pull/48665
# - arch: arm
# platform: linux/arm/v7
- arch: arm64
platform: linux/arm64
needs: [deploy_github_linux]
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"

steps:
- uses: actions/checkout@v2
- uses: arduino/setup-protoc@v1
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart run grinder protobuf
Comment on lines +141 to +145
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the protobuf files generated by these tasks be visible inside the Docker container, or should we run the protobuf compiler in there instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated file is inside workspace, so that it will be available in container. It is easier this way rather than installing protoc inside the container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of using this method to run pkg-standalone-linux-arm64:

https://github.com/ntkme/dart-sass-embedded/runs/5700309782?check_suite_focus=true

- uses: docker/setup-qemu-action@v1
- name: Deploy
run: |
docker run --rm \
--env "GH_BEARER_TOKEN=$GH_BEARER_TOKEN" \
--platform ${{ matrix.platform }} \
--volume "$PWD:$PWD" \
--workdir "$PWD" \
docker.io/library/dart:latest \
/bin/sh -c "dart pub get && dart run grinder pkg-github-linux-${{ matrix.arch }}"
env: {GH_BEARER_TOKEN: "${{ github.token }}"}

deploy_github_macos:
Expand All @@ -134,9 +167,9 @@ jobs:
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart pub run grinder protobuf
- run: dart run grinder protobuf
- name: Deploy
run: dart pub run grinder pkg-github-macos
run: dart run grinder pkg-github-macos
env: {GH_BEARER_TOKEN: "${{ github.token }}"}

deploy_github_windows:
Expand All @@ -151,15 +184,15 @@ jobs:
with: { version: "${{ env.protoc_version }}", repo-token: "${{ github.token }}" }
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart pub run grinder protobuf
- run: dart run grinder protobuf
- name: Deploy
run: dart pub run grinder pkg-github-windows
run: dart run grinder pkg-github-windows
env: {GH_BEARER_TOKEN: "${{ github.token }}"}

release_embedded_host:
name: "Release Embedded Host"
runs-on: ubuntu-latest
needs: [deploy_github_linux, deploy_github_macos, deploy_github_windows]
needs: [deploy_github_linux, deploy_github_linux_qemu, deploy_github_macos, deploy_github_windows]
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/dart-sass-embedded'"

steps:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
typed_data: ^1.1.0

dev_dependencies:
cli_pkg: ^1.4.0
cli_pkg: ^2.1.0
grinder: ^0.9.0
protoc_plugin: ^20.0.0
test: ^1.0.0
Expand All @@ -31,4 +31,4 @@ dev_dependencies:
pubspec_parse: ^1.0.0
pub_semver: ^2.0.0
sass_analysis:
git: {url: git://github.com/sass/dart-sass, path: analysis}
git: {url: https://github.com/sass/dart-sass.git, path: analysis}
2 changes: 1 addition & 1 deletion tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dart pub run protoc_plugin %*
}

if (Platform.environment['UPDATE_SASS_PROTOCOL'] != 'false') {
await cloneOrPull("git://github.com/sass/embedded-protocol");
await cloneOrPull("https://github.com/sass/embedded-protocol.git");
}

await runAsync("protoc",
Expand Down