Skip to content

Merge pull request #322 from vechain/dev #21

Merge pull request #322 from vechain/dev

Merge pull request #322 from vechain/dev #21

Workflow file for this run

name: Release native version
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
create-gh-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
# as electron-builder needs draft to upload artifacts, create a draft first
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
release-electron:
needs: create-gh-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'npm'
- name: Install libs on ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt install -y libusb-1.0-0-dev libudev-dev
- name: Install Dependencies
run: npm ci
- name: Build and Release
run: npx quasar build -m electron
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
release-electron-macos:
needs: create-gh-release
runs-on: self_mac_11.0
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Setup macOS Notarization env
run: |
rm -fr ~/private_keys && mkdir ~/private_keys
echo $APPLE_AUTH_PRIVATE_KEY | base64 -D > ~/private_keys/AuthKey_${APPLE_API_KEY_ID}.p8
env:
APPLE_AUTH_PRIVATE_KEY: ${{secrets.APPLE_AUTH_PRIVATE_KEY}}
APPLE_API_KEY_ID: ${{secrets.APPLE_API_KEY_ID}}
- name: Build and Release
run: npx quasar build -m electron
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
release-android:
needs: create-gh-release
runs-on: self_mac_11.0
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Build bundle
run: npx quasar build -m android -- -- --packageType=bundle
- name: Copy built aab file
run: |
mkdir -p dist/android/bundle
cp dist/cordova/android/bundle/release/*.aab dist/android/bundle/
- name: Build apk
run: npx quasar build -m android -- -- --packageType=apk
- name: Copy built apk file
run: |
mkdir -p dist/android/apk
cp dist/cordova/android/apk/release/*.apk dist/android/apk/
- uses: r0adkll/sign-android-release@v1
name: Sign APK
id: sign_apk
with:
releaseDirectory: dist/android/apk
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "32.0.0"
- uses: r0adkll/sign-android-release@v1
name: Sign Bundle
id: sign_bundle
with:
releaseDirectory: dist/android/bundle
signingKeyBase64: ${{ secrets.UPLOAD_KEY }}
alias: ${{ secrets.UPLOAD_KEY_ALIAS }}
keyStorePassword: ${{ secrets.UPLOAD_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.UPLOAD_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "32.0.0"
- name: Set up variable
id: vars
run: echo "tag=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Rename apk file
run: mv ${{steps.sign_apk.outputs.signedReleaseFile}} dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk
- name: Rename bundle file
run: mv ${{steps.sign_bundle.outputs.signedReleaseFile}} dist/android/bundle/Sync2-android-${{ steps.vars.outputs.tag }}.aab
- name: Calculate checksum of output file
run: shasum -a 512 dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk | cut -f1 -d\ | xxd -r -p | base64 -b 0 > dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}-apk-SHASUM
- name: Upload apk to GH release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}.apk
dist/android/apk/Sync2-android-${{ steps.vars.outputs.tag }}-apk-SHASUM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload aab to artifacts
uses: actions/upload-artifact@v3
with:
path: dist/android/bundle/Sync2-android-${{ steps.vars.outputs.tag }}.aab