Skip to content

Commit

Permalink
check with arm
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich committed Oct 7, 2024
1 parent 4ae94a6 commit ca72a8c
Showing 1 changed file with 49 additions and 38 deletions.
87 changes: 49 additions & 38 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Cedar-agent cross-build and Docker Build

on:
release:
types: [published]
on: push
# release:
# types: [published]

env:
# The project name specified in Cargo.toml
Expand All @@ -20,6 +20,9 @@ jobs:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: linux-arm64
runner: ubuntu-latest
target: aarch64-unknown-linux-gnu
# ------- Lets keep this commented out for now for future optional use
# - name: win-amd64
# runner: windows-latest
Expand Down Expand Up @@ -56,48 +59,56 @@ jobs:
- name: Build Binary
run: cargo build --verbose --release --target ${{ matrix.target }} # --locked have been removed to avoid error

- name: Build ARM64
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --all --release --target=aarch64-unknown-linux-musl

- name: Dry run cargo publish
run: cargo publish --dry-run --allow-dirty --target ${{ matrix.target }}

- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: cedar-agent-${{ github.event.release.tag_name }}
token: ${{ secrets.TOKEN_GITHUB }}
# - uses: taiki-e/upload-rust-binary-action@v1
# with:
# bin: cedar-agent-${{ github.event.release.tag_name }}
# token: ${{ secrets.TOKEN_GITHUB }}

- name: Publish package to crates.io
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# - name: Publish package to crates.io
# run: cargo publish --token ${CRATES_TOKEN}
# env:
# CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

docker-build-push:
runs-on: ubuntu-latest
timeout-minutes: 70
needs: build-cross-package
steps:
- name: Checkout repository
uses: actions/checkout@v3
# docker-build-push:
# runs-on: ubuntu-latest
# timeout-minutes: 70
# needs: build-cross-package
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build & Push cedar-agent
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
cache-from: type=registry,ref=permitio/cedar-agent:latest
cache-to: type=inline
tags: |
permitio/cedar-agent:latest
permitio/cedar-agent:${{ github.event.release.tag_name }}
# - name: Build & Push cedar-agent
# uses: docker/build-push-action@v4
# with:
# file: Dockerfile
# platforms: linux/amd64,linux/arm64
# push: true
# cache-from: type=registry,ref=permitio/cedar-agent:latest
# cache-to: type=inline
# tags: |
# permitio/cedar-agent:latest
# permitio/cedar-agent:${{ github.event.release.tag_name }}

0 comments on commit ca72a8c

Please sign in to comment.