Skip to content

Commit b379485

Browse files
committed
add openssl workflow
1 parent f12e803 commit b379485

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.github/workflows/openssl.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
on:
2+
# push:
3+
# branches: [master]
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master]
7+
8+
name: Create OpenSSl Release
9+
10+
jobs:
11+
build:
12+
name: compile OpenSSl then deploy
13+
runs-on: macos-13
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
- name: Read Tag Version
18+
run: |
19+
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
20+
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs > constants.env
21+
# git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs > constants.env
22+
d=$(TZ=UTC-8 date +'%y%m%d%H%M%S')
23+
grep GIT_OPENSSL_VERSION= ./init-cfgs/openssl | awk -v d="$d" -F = '{printf "RELEASE_VERSION=%s-%s",$2,d}' | xargs > constants.env
24+
cat constants.env
25+
- name: Export Env
26+
uses: cardinalby/export-env-action@v2
27+
with:
28+
envFile: 'constants.env'
29+
- name: init src
30+
run: ./init-any.sh all openssl
31+
- name: generate src log
32+
run: |
33+
cd build/src/macos
34+
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../macos-src-log.md
35+
cd ../ios
36+
ls | awk -F ' ' '{printf "echo %s\n echo -------------\ngit -C %s log -n 1 | cat\n",$0,$0}' | bash > ../ios-src-log.md
37+
- name: do compile macos libs
38+
run: |
39+
cd macos
40+
./compile-any.sh build openssl
41+
./compile-any.sh lipo openssl
42+
- name: do compile ios libs
43+
run: |
44+
cd ios
45+
./compile-any.sh build openssl
46+
./compile-any.sh lipo openssl
47+
- name: Zip macos libs
48+
run: |
49+
cd build/product/macos/universal
50+
zip -rq macos-universal.zip ./*
51+
- name: Zip ios libs
52+
run: |
53+
cd build/product/ios/universal
54+
zip -rq ios-universal.zip ./*
55+
- name: Create Release
56+
id: create_release
57+
uses: actions/create-release@v1
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
with:
61+
tag_name: ${{ env.RELEASE_VERSION }}
62+
release_name: Release ${{ env.RELEASE_VERSION }}
63+
draft: false
64+
prerelease: false
65+
- name: Upload macos Release Asset
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
71+
asset_path: build/product/macos/universal/macos-universal.zip
72+
asset_name: "macos-universal-${{ env.RELEASE_VERSION }}.zip"
73+
asset_content_type: application/zip
74+
- name: Upload ios Release Asset
75+
uses: actions/upload-release-asset@v1
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
with:
79+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
80+
asset_path: build/product/ios/universal/ios-universal.zip
81+
asset_name: "ios-universal-${{ env.RELEASE_VERSION }}.zip"
82+
asset_content_type: application/zip
83+
- name: Upload macos src md
84+
uses: actions/upload-release-asset@v1
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
with:
88+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
89+
asset_path: build/src/macos-src-log.md
90+
asset_name: "macos-src-log-${{ env.RELEASE_VERSION }}.md"
91+
asset_content_type: application/text
92+
- name: Upload ios src md
93+
uses: actions/upload-release-asset@v1
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
with:
97+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
98+
asset_path: build/src/ios-src-log.md
99+
asset_name: "ios-src-log-${{ env.RELEASE_VERSION }}.md"
100+
asset_content_type: application/text

init-cfgs/openssl

+1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ fi
2525

2626
export GIT_LOCAL_REPO=build/extra/openssl
2727
export GIT_COMMIT=OpenSSL_1_1_1u
28+
export GIT_OPENSSL_VERSION=1.1.1u
2829
export REPO_DIR=openssl

0 commit comments

Comments
 (0)