Skip to content

Release generator

Release generator #28

name: Release generator
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
env:
CMAKE_BUILD_TYPE: RelWithDebInfo
jobs:
create-linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get required tools
run: sudo apt install gcc-9 g++-9 zip
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
env:
CC: gcc-9
CXX: g++-9
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Zip executable
working-directory: ${{github.workspace}}/build
run: zip signet_linux signet
- uses: actions/upload-artifact@v4
with:
name: signet_linux.zip
path: build/signet_linux.zip
- uses: actions/upload-artifact@v4
with:
name: RELEASE.md
path: ./RELEASE.md
create-macos-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake Using Default Compiler
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
- name: Install Code Signing Certificate
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CODESIGN_CERT_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_CODESIGN_CERT_PASSWORD }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Sign executable
env:
IDENTITY: ${{ secrets.APPLE_CODESIGN_CERT_IDENTITY }}
working-directory: ${{github.workspace}}/build
run:
codesign --sign "$IDENTITY" --timestamp --options=runtime signet -v
- name: Zip executable
working-directory: ${{github.workspace}}/build
shell: bash
run: zip signet_macos signet
- name: Notarize executable
env:
APPLE_ID: ${{ secrets.APPLE_NOTARIZE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
working-directory: ${{github.workspace}}/build
run: |
xcrun notarytool submit signet_macos.zip --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait
rm signet
unzip signet_macos.zip
rm signet_macos.zip
xcrun stapler staple signet
zip signet_macos.zip signet
- uses: actions/upload-artifact@v4
with:
name: signet_macos.zip
path: build/signet_macos.zip
create-windows-binary:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake using default compiler
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Copy executable to build directory
# When building visual studio projects, it puts the binaries in subdirectories
shell: bash
working-directory: ${{github.workspace}}/build
run: mv $CMAKE_BUILD_TYPE/signet.exe ./signet.exe
- name: Zip executable
working-directory: ${{github.workspace}}/build
run: 7z a signet_windows.zip signet.exe
- uses: actions/upload-artifact@v4
with:
name: signet_windows.zip
path: build/signet_windows.zip
generate-release:
runs-on: ubuntu-latest
needs: [create-linux-binary, create-windows-binary, create-macos-binary]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Get Artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -la
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: true
body_path: RELEASE.md/RELEASE.md
files: |
RELEASE.md/*
signet_linux.zip/*
signet_windows.zip/*
signet_macos.zip/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}