Build release workflow #21
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
name: Build release workflow | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag name' | |
required: true | |
type: string | |
target_os: | |
description: 'Target OS for build' | |
required: true | |
type: choice | |
options: | |
- All | |
- Linux | |
- Windows | |
- macOS | |
- Android | |
prerelease: | |
description: "True to set 'Pre-Release' option" | |
required: true | |
type: boolean | |
draft: | |
description: "True to set 'Draft' option" | |
required: true | |
type: boolean | |
jobs: | |
create_release: | |
runs-on: ubuntu-22.04 | |
name: Create github release | |
outputs: | |
upload_url: > | |
${{ steps.get_release.outputs.upload_url || | |
steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Try to Get Release | |
id: get_release | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
- name: Create Release | |
id: create_release | |
if: ${{ !steps.get_release.outputs.upload_url }} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ inputs.tag }} | |
release_name: ${{ inputs.tag }} | |
draft: ${{ inputs.draft }} | |
prerelease: ${{ inputs.prerelease }} | |
build_osx: | |
needs: create_release | |
runs-on: macos-11 | |
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'macOS' }} | |
name: create release for macOS | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set outputs for pkg_ver | |
id: set_vars | |
run: | | |
source ./contrib/dash/travis/electrum_dash_version_env.sh | |
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT | |
- name: Prepare build | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/install-osx.sh | |
- name: Build dmg | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/script-osx.sh | |
- name: Upload Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-macosx.dmg | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-macosx.dmg | |
build_apk: | |
needs: create_release | |
runs-on: ubuntu-22.04 | |
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Android' }} | |
strategy: | |
matrix: | |
arch: ['armeabi-v7a', 'arm64-v8a'] | |
is_mainnet: [['true', 'Electrum_DASH'], | |
['false', 'Electrum_DASH_Testnet']] | |
env: | |
APP_ANDROID_ARCH: ${{ matrix.arch }} | |
ELECTRUM_MAINNET: ${{ matrix.is_mainnet[0] }} | |
name: create release for Android | |
steps: | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install gettext python3-virtualenv | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set outputs for pkg_ver, apk_ver, vercode, is_release | |
id: set_vars | |
run: | | |
source ./contrib/dash/travis/electrum_dash_version_env.sh | |
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT | |
echo "apk_ver=$(echo $DASH_ELECTRUM_APK_VERSION)" >> $GITHUB_OUTPUT | |
echo "vercode=$(echo $DASH_ELECTRUM_VERSION_CODE)" >> $GITHUB_OUTPUT | |
echo "is_release=$(echo $IS_RELEASE)" >> $GITHUB_OUTPUT | |
- name: Prepare build | |
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }} | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
DASH_ELECTRUM_APK_VERSION: ${{ steps.set_vars.outputs.apk_ver }} | |
DASH_ELECTRUM_VERSION_CODE: ${{ steps.set_vars.outputs.vercode }} | |
IS_RELEASE: ${{ steps.set_vars.outputs.is_release }} | |
run: | | |
./contrib/dash/actions/install-linux-apk.sh | |
- name: Build apk | |
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }} | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
DASH_ELECTRUM_APK_VERSION: ${{ steps.set_vars.outputs.apk_ver }} | |
DASH_ELECTRUM_VERSION_CODE: ${{ steps.set_vars.outputs.vercode }} | |
IS_RELEASE: ${{ steps.set_vars.outputs.is_release }} | |
run: | | |
./contrib/dash/actions/script-linux-apk.sh | |
- name: Upload Release Asset | |
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }} | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/${{ matrix.is_mainnet[1] }}-${{ steps.set_vars.outputs.apk_ver }}-${{ matrix.arch }}-release-unsigned.apk | |
asset_name: ${{ matrix.is_mainnet[1] }}-${{ steps.set_vars.outputs.apk_ver }}-${{ matrix.arch }}-release-unsigned.apk | |
build_linux: | |
needs: create_release | |
runs-on: ubuntu-22.04 | |
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Linux' }} | |
name: create release for Linux | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set outputs for pkg_ver | |
id: set_vars | |
run: | | |
source ./contrib/dash/travis/electrum_dash_version_env.sh | |
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT | |
- name: Prepare build | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/install-linux.sh | |
- name: Build Linux | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/script-linux.sh | |
- name: Upload sdist tar.gz Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.tar.gz | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.tar.gz | |
- name: Upload sdist zip Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.zip | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.zip | |
- name: Upload AppImage Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-x86_64.AppImage | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-x86_64.AppImage | |
build_windows: | |
needs: create_release | |
runs-on: ubuntu-22.04 | |
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Windows' }} | |
name: create release for Windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set outputs for pkg_ver | |
id: set_vars | |
run: | | |
source ./contrib/dash/travis/electrum_dash_version_env.sh | |
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT | |
- name: Prepare build | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/install-wine.sh | |
- name: Build Windows | |
env: | |
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }} | |
run: | | |
./contrib/dash/actions/script-wine.sh | |
- name: Upload Win32 Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win32.exe | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win32.exe | |
- name: Upload Win64 Release Asset | |
uses: Bertrand256/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ inputs.tag }} | |
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win64.exe | |
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win64.exe |