Skip to content

Commit 6942d88

Browse files
authored
Merge pull request #119 from aws/workflow/osx-build
Add macOS build and test GitHub workflow script
2 parents a383d20 + eb23511 commit 6942d88

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/macos_build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: MacOS build and test rolesanywhere-credential-helper
2+
on:
3+
push:
4+
branches: [ main ]
5+
6+
permissions:
7+
statuses: write
8+
id-token: write
9+
10+
jobs:
11+
OSX:
12+
name: Build on ${{matrix.runner_image}}
13+
runs-on: ${{matrix.runner_image}}
14+
strategy:
15+
matrix:
16+
include:
17+
- runner_image: macos-13
18+
arch: "X86_64"
19+
display_name: "MacOS X86_64"
20+
- runner_image: macos-14
21+
arch: "Aarch64"
22+
display_name: "MacOS Aarch64"
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup go
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version-file: 'go.mod'
32+
cache: true
33+
34+
- name: Build Project
35+
run: |
36+
echo "Building on ${{ matrix.display_name }}"
37+
make release
38+
make test
39+
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v4.2.0
42+
with:
43+
role-to-assume: ${{ secrets.BINARY_BUILDING_ROLE_ARN }}
44+
role-session-name: githubmacosbuild
45+
aws-region: us-west-2
46+
47+
- name: Upload to S3
48+
id: s3
49+
run: |
50+
S3_DESTINATION="s3://${{ secrets.INTERMEDIATE_BUCKET_NAME }}"
51+
if [[ "${{ matrix.arch }}" == "X86_64" ]]; then
52+
S3_PATH=${{ secrets.MACOS_X86_64_S3_PATH }}
53+
else
54+
S3_PATH=${{ secrets.MACOS_AARCH64_S3_PATH }}
55+
fi
56+
aws s3 cp build/bin/aws_signing_helper "${S3_DESTINATION}/${S3_PATH}/aws_signing_helper"

0 commit comments

Comments
 (0)