34
34
tailnet-integration : ${{ steps.filter.outputs.tailnet-integration }}
35
35
steps :
36
36
- name : Harden Runner
37
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
37
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
38
38
with :
39
39
egress-policy : audit
40
40
@@ -155,7 +155,7 @@ jobs:
155
155
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
156
156
steps :
157
157
- name : Harden Runner
158
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
158
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
159
159
with :
160
160
egress-policy : audit
161
161
@@ -227,7 +227,7 @@ jobs:
227
227
if : always()
228
228
steps :
229
229
- name : Harden Runner
230
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
230
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
231
231
with :
232
232
egress-policy : audit
233
233
@@ -281,7 +281,7 @@ jobs:
281
281
timeout-minutes : 7
282
282
steps :
283
283
- name : Harden Runner
284
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
284
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
285
285
with :
286
286
egress-policy : audit
287
287
@@ -322,7 +322,7 @@ jobs:
322
322
- windows-2022
323
323
steps :
324
324
- name : Harden Runner
325
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
325
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
326
326
with :
327
327
egress-policy : audit
328
328
@@ -381,7 +381,7 @@ jobs:
381
381
timeout-minutes : 25
382
382
steps :
383
383
- name : Harden Runner
384
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
384
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
385
385
with :
386
386
egress-policy : audit
387
387
@@ -426,7 +426,7 @@ jobs:
426
426
timeout-minutes : 25
427
427
steps :
428
428
- name : Harden Runner
429
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
429
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
430
430
with :
431
431
egress-policy : audit
432
432
@@ -463,7 +463,7 @@ jobs:
463
463
timeout-minutes : 25
464
464
steps :
465
465
- name : Harden Runner
466
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
466
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
467
467
with :
468
468
egress-policy : audit
469
469
@@ -508,7 +508,7 @@ jobs:
508
508
timeout-minutes : 20
509
509
steps :
510
510
- name : Harden Runner
511
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
511
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
512
512
with :
513
513
egress-policy : audit
514
514
@@ -534,7 +534,7 @@ jobs:
534
534
timeout-minutes : 20
535
535
steps :
536
536
- name : Harden Runner
537
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
537
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
538
538
with :
539
539
egress-policy : audit
540
540
@@ -566,7 +566,7 @@ jobs:
566
566
name : ${{ matrix.variant.name }}
567
567
steps :
568
568
- name : Harden Runner
569
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
569
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
570
570
with :
571
571
egress-policy : audit
572
572
@@ -630,7 +630,7 @@ jobs:
630
630
if : needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
631
631
steps :
632
632
- name : Harden Runner
633
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
633
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
634
634
with :
635
635
egress-policy : audit
636
636
@@ -707,7 +707,7 @@ jobs:
707
707
708
708
steps :
709
709
- name : Harden Runner
710
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
710
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
711
711
with :
712
712
egress-policy : audit
713
713
@@ -780,7 +780,7 @@ jobs:
780
780
if : always()
781
781
steps :
782
782
- name : Harden Runner
783
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
783
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
784
784
with :
785
785
egress-policy : audit
786
786
@@ -806,10 +806,91 @@ jobs:
806
806
807
807
echo "Required checks have passed"
808
808
809
+ # Builds the dylibs and upload it as an artifact so it can be embedded in the main build
810
+ build-dylib :
811
+ needs : changes
812
+ # We always build the dylibs on Go changes to verify we're not merging unbuildable code,
813
+ # but they need only be signed and uploaded on coder/coder main.
814
+ if : needs.changes.outputs.docs-only == 'false' || github.ref == 'refs/heads/main'
815
+ runs-on : ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}
816
+ steps :
817
+ - name : Harden Runner
818
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
819
+ with :
820
+ egress-policy : audit
821
+
822
+ - name : Checkout
823
+ uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
824
+ with :
825
+ fetch-depth : 0
826
+
827
+ - name : Setup build tools
828
+ run : |
829
+ brew install bash gnu-getopt make
830
+ echo "$(brew --prefix bash)/bin" >> $GITHUB_PATH
831
+ echo "$(brew --prefix gnu-getopt)/bin" >> $GITHUB_PATH
832
+ echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
833
+
834
+ - name : Setup Go
835
+ uses : ./.github/actions/setup-go
836
+
837
+ - name : Install rcodesign
838
+ if : ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
839
+ run : |
840
+ set -euo pipefail
841
+ wget -O /tmp/rcodesign.tar.gz https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-macos-universal.tar.gz
842
+ sudo tar -xzf /tmp/rcodesign.tar.gz \
843
+ -C /usr/local/bin \
844
+ --strip-components=1 \
845
+ apple-codesign-0.22.0-macos-universal/rcodesign
846
+ rm /tmp/rcodesign.tar.gz
847
+
848
+ - name : Setup Apple Developer certificate and API key
849
+ if : ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
850
+ run : |
851
+ set -euo pipefail
852
+ touch /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
853
+ chmod 600 /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
854
+ echo "$AC_CERTIFICATE_P12_BASE64" | base64 -d > /tmp/apple_cert.p12
855
+ echo "$AC_CERTIFICATE_PASSWORD" > /tmp/apple_cert_password.txt
856
+ echo "$AC_APIKEY_P8_BASE64" | base64 -d > /tmp/apple_apikey.p8
857
+ env :
858
+ AC_CERTIFICATE_P12_BASE64 : ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
859
+ AC_CERTIFICATE_PASSWORD : ${{ secrets.AC_CERTIFICATE_PASSWORD }}
860
+ AC_APIKEY_P8_BASE64 : ${{ secrets.AC_APIKEY_P8_BASE64 }}
861
+
862
+ - name : Build dylibs
863
+ run : |
864
+ set -euxo pipefail
865
+ go mod download
866
+
867
+ make gen/mark-fresh
868
+ make build/coder-dylib
869
+ env :
870
+ CODER_SIGN_DARWIN : ${{ github.ref == 'refs/heads/main' && '1' || '0' }}
871
+ AC_CERTIFICATE_FILE : /tmp/apple_cert.p12
872
+ AC_CERTIFICATE_PASSWORD_FILE : /tmp/apple_cert_password.txt
873
+
874
+ - name : Upload build artifacts
875
+ if : ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
876
+ uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
877
+ with :
878
+ name : dylibs
879
+ path : |
880
+ ./build/*.h
881
+ ./build/*.dylib
882
+ retention-days : 7
883
+
884
+ - name : Delete Apple Developer certificate and API key
885
+ if : ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
886
+ run : rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
887
+
809
888
build :
810
889
# This builds and publishes ghcr.io/coder/coder-preview:main for each commit
811
890
# to main branch.
812
- needs : changes
891
+ needs :
892
+ - changes
893
+ - build-dylib
813
894
if : github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
814
895
runs-on : ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
815
896
permissions :
@@ -820,7 +901,7 @@ jobs:
820
901
IMAGE : ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }}
821
902
steps :
822
903
- name : Harden Runner
823
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
904
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
824
905
with :
825
906
egress-policy : audit
826
907
@@ -848,6 +929,18 @@ jobs:
848
929
- name : Install zstd
849
930
run : sudo apt-get install -y zstd
850
931
932
+ - name : Download dylibs
933
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
934
+ with :
935
+ name : dylibs
936
+ path : ./build
937
+
938
+ - name : Insert dylibs
939
+ run : |
940
+ mv ./build/*amd64.dylib ./site/out/bin/coder-vpn-darwin-amd64.dylib
941
+ mv ./build/*arm64.dylib ./site/out/bin/coder-vpn-darwin-arm64.dylib
942
+ mv ./build/*arm64.h ./site/out/bin/coder-vpn-darwin-dylib.h
943
+
851
944
- name : Build
852
945
run : |
853
946
set -euxo pipefail
@@ -944,7 +1037,7 @@ jobs:
944
1037
id-token : write
945
1038
steps :
946
1039
- name : Harden Runner
947
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
1040
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
948
1041
with :
949
1042
egress-policy : audit
950
1043
@@ -1006,7 +1099,7 @@ jobs:
1006
1099
if : github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
1007
1100
steps :
1008
1101
- name : Harden Runner
1009
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
1102
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
1010
1103
with :
1011
1104
egress-policy : audit
1012
1105
@@ -1041,7 +1134,7 @@ jobs:
1041
1134
if : needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
1042
1135
steps :
1043
1136
- name : Harden Runner
1044
- uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
1137
+ uses : step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
1045
1138
with :
1046
1139
egress-policy : audit
1047
1140
0 commit comments