mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-23 15:08:32 +00:00
Add build process for Darwin binaries in PR workflow
This commit is contained in:
38
.github/workflows/pr-build.yml
vendored
38
.github/workflows/pr-build.yml
vendored
@@ -72,4 +72,42 @@ jobs:
|
||||
with:
|
||||
name: agent-${{matrix.architecture}}.tar
|
||||
path: agent-${{matrix.architecture}}.tar
|
||||
|
||||
build-darwin:
|
||||
runs-on: ubuntu-24.04
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [amd64, arm64]
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- uses: benjlevesque/short-sha@v2.1
|
||||
id: short-sha
|
||||
with:
|
||||
length: 7
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Build Darwin binary with Docker
|
||||
run: |
|
||||
docker build -f Dockerfile.cross \
|
||||
--build-arg GOOS=darwin \
|
||||
--build-arg GOARCH=${{matrix.architecture}} \
|
||||
-t darwin-${{matrix.architecture}} .
|
||||
CID=$(docker create darwin-${{matrix.architecture}})
|
||||
docker cp ${CID}:/home/agent ./output-${{matrix.architecture}}
|
||||
docker rm ${CID}
|
||||
- name: Tar Darwin binary and clean
|
||||
run: tar -cf agent-darwin-${{matrix.architecture}}.tar -C output-${{matrix.architecture}} . && rm -rf output-${{matrix.architecture}}
|
||||
- name: Upload darwin artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: agent-darwin-${{matrix.architecture}}.tar
|
||||
path: agent-darwin-${{matrix.architecture}}.tar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user