Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Add release.yml workflow. #282

Open
wants to merge 1 commit into
base: 8.3-stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Copyright 2022 The Tongsuo Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://github.com/Tongsuo-Project/Tongsuo/blob/master/LICENSE.txt

name: Tongsuo Release

on:
release:
types:
- published
branches:
- 8.3-stable

jobs:
build-linux:
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
arch: x86-64-linux-gnu
libs: libc6-dev-amd64-cross
cc_prefix: x86_64-linux-gnu-
rpath: '/opt/tongsuo/lib64:./opt/tongsuo/lib64:./tongsuo/lib64'
target: linux-x86_64
- os: ubuntu-latest
arch: aarch64-linux-gnu
libs: libc6-dev-arm64-cross
cc_prefix: aarch64-linux-gnu-
rpath: '/opt/tongsuo/lib64:./opt/tongsuo/lib64:./tongsuo/lib64'
target: linux-aarch64
- os: macos-10.15
rpath: '/opt/tongsuo/lib64:./opt/tongsuo/lib64:./tongsuo/lib64'
target: darwin64-x86_64-cc
runs-on: ${{ matrix.platform.os }}
steps:
- name: install packages
if: ${{ matrix.platform.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get -yq --force-yes install \
gcc-${{ matrix.platform.arch }} \
${{ matrix.platform.libs }}
- uses: actions/checkout@v2
- name: config
run: ./Configure --prefix=/opt/tongsuo --cross-compile-prefix=${{ matrix.platform.cc_prefix }} ${{ matrix.platform.target }} -Wl,-rpath,${{ matrix.platform.rpath }} enable-ssl-trace enable-crypto-mdebug enable-crypto-mdebug-backtrace enable-egd enable-ntls enable-optimize-chacha enable-status enable-cert-compression enable-delegated-credential enable-ec_elgamal enable-sm2 enable-sm3 enable-sm4 enable-dynamic-ciphers enable-session-lookup enable-session-reused-type enable-rsa-multi-prime-key-compat enable-skip-scsv enable-verify-sni enable-evp-cipher-api-compat enable-dycert-ocsp && perl configdata.pm --dump
- name: make
run: make -j
- name: make install
run: sudo make install
- name: pack
run: tar zcvf ./tongsuo-${{ matrix.platform.target }}.tar.gz /opt/tongsuo
- name: upload
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
tongsuo-${{ matrix.platform.target }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: debug with ssh tunnel
if: ${{ failure() }}
uses: wa5i/ssh-to-actions@main
with:
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
NPS_SERVER: ${{ secrets.NPS_SERVER }}
NPS_VKEY: ${{ secrets.NPS_VKEY }}
build-windows:
strategy:
matrix:
platform:
- arch: win64
config: VC-WIN64A
- arch: win32
config: VC-WIN32
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform.arch }}
- uses: ilammy/setup-nasm@v1
with:
platform: ${{ matrix.platform.arch }}
- uses: shogo82148/actions-setup-perl@v1
- name: prepare the build directory
run: mkdir _build
- name: config
working-directory: _build
run: |
perl ..\Configure no-makedepend ${{ matrix.platform.config }} enable-ssl-trace enable-crypto-mdebug no-crypto-mdebug-backtrace enable-egd enable-ntls enable-optimize-chacha enable-status enable-cert-compression enable-delegated-credential enable-ec_elgamal enable-sm2 enable-sm3 enable-sm4 enable-dynamic-ciphers enable-session-lookup enable-session-reused-type enable-rsa-multi-prime-key-compat enable-skip-scsv enable-verify-sni enable-evp-cipher-api-compat enable-dycert-ocsp
perl configdata.pm --dump
- name: build
working-directory: _build
run: nmake /S
- name: install
run: |
mkdir ..\tongsuo
nmake install DESTDIR=..\tongsuo
working-directory: _build
- name: pack
run: tar zcvf .\tongsuo-${{ matrix.platform.arch }}.tar.gz .\tongsuo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows也用tar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows也用tar?

可以的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是说你打包的环境,而是大多数用户的windows环境里都自带tar?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来直接zip一下貌似就OK了。zip好像windows里默认可以解压缩

- name: upload
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
tongsuo-${{ matrix.platform.arch }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: debug with ssh tunnel
if: ${{ failure() }}
uses: wa5i/ssh-to-actions@main
with:
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
NPS_SERVER: ${{ secrets.NPS_SERVER }}
NPS_VKEY: ${{ secrets.NPS_VKEY }}