2021-11-30 23:36:51 +00:00
|
|
|
name: Binary Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
paths:
|
|
|
|
- '.version'
|
|
|
|
|
|
|
|
jobs:
|
2021-12-01 11:43:11 +00:00
|
|
|
publish_binary_release:
|
2022-09-25 10:17:27 +00:00
|
|
|
name: Publish binary release
|
2022-05-17 16:07:26 +00:00
|
|
|
runs-on: macos-12
|
2021-11-30 23:36:51 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build OpenSSL
|
|
|
|
id: lib
|
|
|
|
timeout-minutes: 60
|
2021-12-01 12:10:06 +00:00
|
|
|
env:
|
|
|
|
OPENSSL_TARGETS: "ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-x86_64 mac-catalyst-arm64"
|
2021-11-30 23:36:51 +00:00
|
|
|
run: |
|
2021-12-01 11:43:11 +00:00
|
|
|
source scripts/get-openssl-version.sh
|
2021-11-30 23:36:51 +00:00
|
|
|
|
2021-12-01 11:43:11 +00:00
|
|
|
COMPOUND_VERSION=`cat .version`
|
|
|
|
OPENSSL_VERSION=${COMPOUND_VERSION%-*}
|
|
|
|
SCRIPT_VERSION=${COMPOUND_VERSION#*-}
|
|
|
|
TAG_NAME=$(get_openssl_version $OPENSSL_VERSION $SCRIPT_VERSION)
|
2021-11-30 23:36:51 +00:00
|
|
|
|
|
|
|
echo "Compiling OpenSSL $OPENSSL_VERSION"
|
|
|
|
./build-libssl.sh --version="$OPENSSL_VERSION" --targets="$OPENSSL_TARGETS" --disable-bitcode
|
|
|
|
|
|
|
|
echo "::set-output name=tag::$TAG_NAME"
|
|
|
|
echo "::set-output name=openssl_version::$OPENSSL_VERSION"
|
|
|
|
echo "::set-output name=script_version::$SCRIPT_VERSION"
|
|
|
|
- name: Produce dynamic framework
|
|
|
|
id: framework
|
|
|
|
env:
|
|
|
|
FRAMEWORK_DIR: "frameworks"
|
|
|
|
FRAMEWORK: "openssl.xcframework"
|
|
|
|
run: |
|
|
|
|
./create-openssl-framework.sh dynamic
|
|
|
|
( cd $FRAMEWORK_DIR && zip -yr $FRAMEWORK.zip $FRAMEWORK )
|
|
|
|
|
|
|
|
echo "::set-output name=artifact::$FRAMEWORK_DIR/$FRAMEWORK.zip"
|
|
|
|
- name: Import GPG key
|
|
|
|
uses: crazy-max/ghaction-import-gpg@v4
|
|
|
|
with:
|
|
|
|
gpg_private_key: ${{ secrets.GPG_KEY }}
|
|
|
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
|
|
|
git_user_signingkey: true
|
|
|
|
git_commit_gpgsign: true
|
|
|
|
git_tag_gpgsign: true
|
|
|
|
git_push_gpgsign: false
|
|
|
|
- name: Update Package.swift
|
|
|
|
id: package
|
|
|
|
env:
|
2021-12-01 11:43:11 +00:00
|
|
|
TAG_NAME: ${{ steps.lib.outputs.tag }}
|
|
|
|
OPENSSL_VERSION: ${{ steps.lib.outputs.openssl_version }}
|
|
|
|
SCRIPT_VERSION: ${{ steps.lib.outputs.script_version }}
|
|
|
|
PACKAGE_METADATA: "Package.swift"
|
|
|
|
PACKAGE_ARTIFACT: ${{ steps.framework.outputs.artifact }}
|
|
|
|
PACKAGE_CHECKSUM: ${{ steps.framework.outputs.artifact }}.checksum
|
2021-11-30 23:36:51 +00:00
|
|
|
run: |
|
2021-12-01 11:43:11 +00:00
|
|
|
CHECKSUM=`swift package compute-checksum "$PACKAGE_ARTIFACT"`
|
|
|
|
echo $CHECKSUM >$PACKAGE_CHECKSUM
|
2021-11-30 23:36:51 +00:00
|
|
|
|
2021-12-01 11:43:11 +00:00
|
|
|
sed -E "s@/[0-9\.]+/(openssl.xcframework.zip)@/$TAG_NAME/\\1@" $PACKAGE_METADATA |
|
|
|
|
sed -E "s/checksum: \"[0-9a-f]+\"/checksum: \"$CHECKSUM\"/" >$PACKAGE_METADATA.tmp
|
|
|
|
mv $PACKAGE_METADATA.tmp $PACKAGE_METADATA
|
2021-11-30 23:36:51 +00:00
|
|
|
|
|
|
|
RELEASE_NAME="OpenSSL $OPENSSL_VERSION"
|
|
|
|
if [ $SCRIPT_VERSION -gt 0 ]; then
|
|
|
|
RELEASE_NAME="$RELEASE_NAME ($SCRIPT_VERSION)"
|
|
|
|
fi
|
|
|
|
|
2021-12-01 11:43:11 +00:00
|
|
|
git add $PACKAGE_METADATA
|
2021-11-30 23:36:51 +00:00
|
|
|
git commit -m "$RELEASE_NAME"
|
2021-12-01 11:43:11 +00:00
|
|
|
git tag "$TAG_NAME" -m "$RELEASE_NAME"
|
2021-11-30 23:36:51 +00:00
|
|
|
git push && git push --tags
|
|
|
|
|
2021-12-01 11:43:11 +00:00
|
|
|
RELEASE_NOTES="release-notes.txt"
|
|
|
|
echo "Compiled for iOS and macOS (plus Catalyst)." >$RELEASE_NOTES
|
|
|
|
echo >>$RELEASE_NOTES
|
|
|
|
echo "SwiftPM checksum: $CHECKSUM" >>$RELEASE_NOTES
|
2021-11-30 23:36:51 +00:00
|
|
|
|
|
|
|
echo "::set-output name=release_name::$RELEASE_NAME"
|
2021-12-01 11:43:11 +00:00
|
|
|
echo "::set-output name=release_notes::$RELEASE_NOTES"
|
|
|
|
echo "::set-output name=checksum::$PACKAGE_CHECKSUM"
|
2021-11-30 23:36:51 +00:00
|
|
|
- name: Publish release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
name: ${{ steps.package.outputs.release_name }}
|
2021-12-01 11:43:11 +00:00
|
|
|
body_path: ${{ steps.package.outputs.release_notes }}
|
2021-11-30 23:36:51 +00:00
|
|
|
tag_name: ${{ steps.lib.outputs.tag }}
|
|
|
|
files: |
|
|
|
|
${{ steps.framework.outputs.artifact }}
|
2021-12-01 11:43:11 +00:00
|
|
|
${{ steps.package.outputs.checksum }}
|