Skip to content

Commit 9c94429

Browse files
authored
Merge branch 'master' into 831-unexpected_status
2 parents 8df325a + 4de9d88 commit 9c94429

File tree

185 files changed

+11489
-3836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+11489
-3836
lines changed

.github/workflows/docs-website.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
npm ci && npm run build && npm run generate
4242
4343
- name: create artifact
44-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
4545
with:
4646
name: dist
4747
path: |
@@ -55,7 +55,7 @@ jobs:
5555
needs:
5656
- docs
5757
steps:
58-
- uses: actions/download-artifact@v2
58+
- uses: actions/download-artifact@v4
5959
with:
6060
name: dist
6161
path: 'dist'

.github/workflows/release.yml

+64-72
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: 'wait for tests'
13-
uses: lewagon/[email protected].3
13+
uses: lewagon/[email protected].4
1414
with:
1515
ref: ${{ github.ref }}
1616
check-name: 'go test & build'
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
wait-interval: 10
1919

20-
linux-windows:
21-
name: 'build linux and windows binaries'
20+
build-all:
21+
name: 'build all binaries'
2222
runs-on: ubuntu-latest
2323
needs:
2424
- test
@@ -29,12 +29,14 @@ jobs:
2929
VERSION_PACKAGE: 'github.com/coupergateway/couper/utils'
3030
strategy:
3131
matrix:
32-
goos: [linux, windows]
32+
goos: [linux, darwin, windows]
3333
goarch: [amd64, arm64]
3434
fail-fast: false
3535
outputs:
3636
linux_amd64: ${{ steps.build.outputs.linux_amd64 }}
3737
linux_arm64: ${{ steps.build.outputs.linux_arm64 }}
38+
darwin_amd64: ${{ steps.build.outputs.darwin_amd64 }}
39+
darwin_arm64: ${{ steps.build.outputs.darwin_arm64 }}
3840
windows_amd64: ${{ steps.build.outputs.windows_amd64 }}
3941
windows_arm64: ${{ steps.build.outputs.windows_arm64 }}
4042
steps:
@@ -46,7 +48,7 @@ jobs:
4648
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
4749
echo "::set-output name=build_date::$(date +'%F')"
4850
49-
- uses: wangyoucao577/go-release-action@v1.40
51+
- uses: wangyoucao577/go-release-action@v1.51
5052
id: build
5153
with:
5254
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -62,11 +64,22 @@ jobs:
6264
overwrite: true
6365
post_command: |
6466
echo "::set-output name=${{ matrix.goos }}_${{ matrix.goarch }}::$SHA256_SUM"
67+
- name: Archive macOS builds
68+
if: ${{ matrix.goos == 'darwin' }}
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: macos-${{ matrix.goarch }}
72+
path: couper-${{ github.ref_name }}-darwin-${{ matrix.goarch }}.tar.gz
73+
retention-days: 1
74+
compression-level: 0
75+
if-no-files-found: error
76+
6577
macos:
66-
name: 'build and sign MacOS binary'
67-
runs-on: macos-11
78+
name: 'sign MacOS binary'
79+
runs-on: ubuntu-latest
6880
needs:
6981
- test
82+
- build-all
7083
strategy:
7184
matrix:
7285
goarch: [amd64, arm64]
@@ -75,85 +88,64 @@ jobs:
7588
contents: write
7689
packages: write
7790
env:
78-
AC_PASSWORD: ${{ secrets.MACOS_DEVELOPER_APPLICATION_PWD }}
7991
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
VERSION_PACKAGE: 'github.com/coupergateway/couper/utils'
8192
outputs:
8293
amd64: ${{ steps.upload.outputs.amd64 }}
8394
arm64: ${{ steps.upload.outputs.arm64 }}
84-
steps:
85-
- uses: actions/checkout@v4
86-
87-
- name: 'setup go'
95+
steps: # Write Apple Store Connect Key & cert to file
96+
- name: 'setup distribution keys'
97+
env:
98+
STORE_CONNECT_KEY: ${{ secrets.APPLE_APP_STORE_CONNECT_KEY_JSON }}
99+
P12_CERT_BASE64: ${{ secrets.APPLE_DIST_CERT_P12_FILE_BASE64 }}
100+
run: |
101+
echo $STORE_CONNECT_KEY > app_store_key.json
102+
echo -n "$P12_CERT_BASE64" | base64 --decode > cert.p12
103+
- name: 'download artifacts'
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: macos-${{ matrix.goarch }}
107+
- name: 'extract artifacts'
108+
run: |
109+
tar -xzf couper-${{ github.ref_name }}-darwin-${{ matrix.goarch }}.tar.gz
110+
- name: Sign
111+
uses: indygreg/apple-code-sign-action@v1
112+
with:
113+
p12_file: cert.p12
114+
p12_password: '${{ secrets.APPLE_DIST_CERT_P12_PASSWORD }}'
115+
sign: true
116+
sign_args: |
117+
--code-signature-flags
118+
runtime
119+
input_path: couper
120+
- name: 'Archive signed macOS binary'
121+
uses: montudor/action-zip@v1
122+
with:
123+
args: zip -qq couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip couper
124+
- name: Notarize
125+
uses: indygreg/apple-code-sign-action@v1
126+
with:
127+
app_store_connect_api_key_json_file: app_store_key.json
128+
sign: false
129+
notarize: true
130+
staple: false # we can't staple mach-o binaries; gatekeeper will check it: `spctl -a -vvv -t install couper`
131+
input_path: ${{ github.workspace }}/couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip
132+
- name: Set up Go 1.x
88133
uses: actions/[email protected]
89134
with:
90135
go-version: '1.22'
91-
92-
- name: Set GOARCH environment variable
93-
run: echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
94-
95-
- name: 'import certificate'
96-
env:
97-
BUILD_CERTIFICATE_BASE64: ${{ secrets.MACOS_CERTIFICATE_BASE64 }}
98-
P12_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
99-
KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
100-
run: |
101-
# create variables
102-
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
103-
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
104-
105-
# import certificate and provisioning profile from secrets
106-
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
107-
108-
# create temporary keychain
109-
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
110-
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
111-
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
112-
113-
# import certificate to keychain
114-
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
115-
security list-keychain -d user -s $KEYCHAIN_PATH
116-
- name: 'install gon'
117-
run: go install github.com/mitchellh/gon/[email protected]
118136
- name: 'install assets-uploader'
119-
run: go install github.com/wangyoucao577/assets-uploader/[email protected]
120-
- name: 'build Couper'
121-
run: |
122-
go build -ldflags "-X ${VERSION_PACKAGE}.VersionName=`git describe --tags --abbrev=0 --exact-match || git symbolic-ref -q --short HEAD` -X ${VERSION_PACKAGE}.BuildName=`git rev-parse --short HEAD` -X ${VERSION_PACKAGE}.BuildDate=`date +'%F'`" -v -o ./.macos/Couper.app/Contents/couper main.go
123-
- name: 'cleanup finder attributes'
124-
run: |
125-
xattr -c ./.macos/Couper.app/Contents/Info.plist
126-
xattr -c ./.macos/Entitlements.plist
127-
plutil -convert xml1 .macos/Entitlements.plist && plutil -lint .macos/Entitlements.plist
128-
- name: 'verify identity'
129-
run: security find-identity -v
130-
- name: 'sign Couper binary'
131-
run: codesign -i "binary.com.xxx.couper" -s "4B8FA10CCB8F16F9F464385768D82645831F4644" -f -v --timestamp --options runtime ./.macos/Couper.app/Contents/couper
132-
- name: 'create signed binary archive' # keep utf8 things with ditto
133-
run: ditto -c -k --sequesterRsrc ./.macos/Couper.app/Contents/couper ./.macos/couper.zip
134-
# - name: 'create macOS dmg with signed binary'
135-
# run: |
136-
# mkdir -p ./.macos/Couper.app/Contents/MacOS
137-
# mv ./.macos/Couper.app/Contents/couper ./.macos/Couper.app/Contents/MacOS/couper
138-
# codesign -s "4B8FA10CCB8F16F9F464385768D82645831F4644" -f -v --timestamp --options runtime --entitlements ./.macos/Entitlements.plist ./.macos/Couper.app/Contents/MacOS/couper
139-
# cd .macos && go run make.go && cd ..
140-
- name: 'notarize' # and stable'
141-
run: gon -log-level=info -log-json ./.gon.hcl
142-
# - name: 'verify image notarization'
143-
# run: spctl --assess --type open --context context:primary-signature -v ./.macos/couper.dmg
144-
- name: 'upload archive'
137+
run: go install github.com/wangyoucao577/assets-uploader/[email protected]
138+
- name: 'upload signed binary archive'
145139
id: 'upload'
146140
run: |
147-
mv ./.macos/couper.zip ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip && github-assets-uploader -f ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip -overwrite -repo coupergateway/couper -releasename $GITHUB_REF_NAME -token $GITHUB_TOKEN
148-
shasum -a 256 ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip | cut -d ' ' -f1 > ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip.sha256 && github-assets-uploader -f ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip.sha256 -overwrite -repo coupergateway/couper -releasename $GITHUB_REF_NAME -token $GITHUB_TOKEN
149-
echo "::set-output name=${{ matrix.goarch }}::$(cat ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.zip.sha256)"
150-
# - name: 'upload image'
151-
# run: mv ./.macos/couper.dmg ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.dmg && github-assets-uploader -f ./couper-$GITHUB_REF_NAME-macos-${{ matrix.goarch }}.dmg -overwrite -repo coupergateway/couper -releasename $GITHUB_REF_NAME -token $GITHUB_TOKEN -mediatype 'application/octet-stream'
141+
github-assets-uploader -f ./couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip -overwrite -repo coupergateway/couper -releasename ${{ github.ref_name }} -token $GITHUB_TOKEN
142+
shasum -a 256 ./couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip | cut -d ' ' -f1 > ./couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip.sha256 && github-assets-uploader -f ./couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip.sha256 -overwrite -repo coupergateway/couper -releasename ${{ github.ref_name }} -token $GITHUB_TOKEN
143+
echo "::set-output name=${{ matrix.goarch }}::$(cat ./couper-${{ github.ref_name }}-macos-${{ matrix.goarch }}.zip.sha256)"
152144
brewlease:
153145
name: 'update homebrew formula'
154146
runs-on: ubuntu-latest
155147
needs:
156-
- linux-windows
148+
- build-all
157149
- macos
158150
steps:
159151
- name: 'checkout'

.github/workflows/weekly-fuzz.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: uploading current state
5252
if: always() # even on previous timeout or cancel
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v4
5454
with:
5555
name: fuzz-results
5656
path: |

.gon.hcl

-15
This file was deleted.

.macos/Couper.app/Contents/Info.plist

-16
This file was deleted.
-284 KB
Binary file not shown.

.macos/Entitlements.plist

-12
This file was deleted.

0 commit comments

Comments
 (0)