-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roy Razon
committed
Jan 10, 2024
1 parent
0beb432
commit d849d05
Showing
2 changed files
with
182 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# release package | ||
name: Github Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build-binaries: | ||
runs-on: macos-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
strategy: | ||
matrix: | ||
arch: [x64,arm64] | ||
platform: [linux,macos,win] | ||
exclude: | ||
- platform: win | ||
arch: arm64 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: depot/setup-action@v1 | ||
with: | ||
oidc: true | ||
|
||
- name: Build using Docker (with depot) | ||
run: mkdir preevy-bin && depot build --project ${{ vars.DEPOT_PROJECT_ID }} --build-arg CLI_TARGET=${{ matrix.platform }}-${{ matrix.arch }} -f Dockerfile.cli --target=cli --output=type=tar,dest=./preevy-bin/preevy-${{ matrix.platform }}-${{ matrix.arch }}.tar --progress=plain --platform=linux/${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} . | ||
|
||
- uses: apple-actions/import-codesign-certs@v2 | ||
if: ${{ matrix.platform == 'macos' }} | ||
with: | ||
p12-file-base64: ${{ secrets.APPLE_CERT_DATA }} | ||
p12-password: ${{ secrets.APPLE_CERT_PASS }} | ||
|
||
- name: Sign mac binaries | ||
if: ${{ matrix.platform == 'macos' }} | ||
env: | ||
CERT_CN: ${{ vars.APPLE_CERT_CN }} | ||
run: | | ||
tar -xf ./preevy-bin/preevy-${{ matrix.platform }}-${{ matrix.arch }}.tar | ||
codesign --remove-signature ./preevy | ||
security find-identity -v | ||
codesign --verbose=4 --sign "$CERT_CN" ./preevy | ||
tar -cf ./preevy-bin/preevy-${{ matrix.platform }}-${{ matrix.arch }}.tar ./preevy | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: preevy-bin-${{ matrix.platform }}-${{ matrix.arch }} | ||
path: ./preevy-bin/** | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: build-binaries | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: depot/setup-action@v1 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: preevy-bin-* | ||
path: ./preevy-bin | ||
merge-multiple: true | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true | ||
draft: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
files: | | ||
./preevy-bin/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters