Merge pull request #465 from sparrowapp-dev/development #25
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: Production Release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
VITE_API_URL: ${{secrets.VITE_API_URL}} | |
VITE_MIX_PANEL_TOKEN: ${{secrets.VITE_MIX_PANEL_TOKEN}} | |
VITE_ENABLE_MIX_PANEL: ${{secrets.VITE_ENABLE_MIX_PANEL}} | |
VITE_API_TIMEOUT: ${{secrets.VITE_API_TIMEOUT}} | |
VITE_SPARROW_SUPPORT_EMAIL: ${{ secrets.VITE_SPARROW_SUPPORT_EMAIL }} | |
VITE_AUTH_URL: ${{ secrets.VITE_AUTH_URL_DEV }} | |
VITE_SPARROW_GITHUB: ${{ secrets.VITE_SPARROW_GITHUB }} | |
VITE_SPARROW_DOWNLOAD_LINK: ${{ secrets.VITE_SPARROW_DOWNLOAD_LINK }} | |
jobs: | |
build_and_release_macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Rust setup | |
uses: dtolnay/rust-toolchain@stable | |
- name: Sync node version and setup cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.8' | |
- name: Build Tauri App | |
run: | | |
TAURI_SIGNING_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}" | |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}" | |
APPLE_SIGNING_IDENTITY="${{ secrets.APPLE_SIGNING_IDENTITY }}" | |
APPLE_CERTIFICATE="${{ secrets.APPLE_CERTIFICATE }}" | |
APPLE_CERTIFICATE_PASSWORD="${{ secrets.APPLE_CERTIFICATE_PASSWORD }}" | |
yarn install | |
yarn tauri build --debug | |
env: | |
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }} | |
- name: dmg sig | |
run: cat /Users/runner/work/sparrow-app/sparrow-app/src-tauri/target/debug/bundle/macos/*.sig | |
- name: Upload mac-build to Azure Blob Storage | |
run: | | |
az storage blob upload --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} --container-name ${{ secrets.AZURE_CONTAINER_NAME }} --file /Users/runner/work/sparrow-app/sparrow-app/src-tauri/target/debug/bundle/dmg/Sparrow_1.1.0_x64.dmg --name Sparrow_1.1.0_x64.dmg --overwrite | |
az storage blob upload --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} --container-name ${{ secrets.AZURE_CONTAINER_NAME }} --file /Users/runner/work/sparrow-app/sparrow-app/src-tauri/target/debug/bundle/macos/Sparrow.app.tar.gz --name Sparrow.app.tar.gz --overwrite | |
env: | |
AZURE_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} | |
AZURE_STORAGE_ACCOUNT_KEY: ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} | |
AZURE_CONTAINER_NAME: ${{ secrets.AZURE_CONTAINER_NAME }} | |
build_and_release_windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.8' | |
- name: Install Windows SDK | |
run: Invoke-WebRequest -Uri https://aka.ms/winsdk/10/latest/SdkSetup.exe -OutFile $env:TEMP\SdkSetup.exe | |
shell: powershell | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1 | |
- name: Build Tauri App | |
run: | | |
$TAURI_SIGNING_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}" | |
$TAURI_SIGNING_PRIVATE_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}" | |
yarn cache clean | |
npm install -g pnpm | |
yarn install | |
yarn tauri build --debug | |
env: | |
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }} | |
- name: msi sig | |
run: Get-Content D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\msi\*.sig | |
- name: nsis sig | |
run: Get-Content D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\nsis\*.sig | |
- name: sign msi | |
run: | | |
$cert = New-SelfSignedCertificate -Subject "CN=Certificate" -CertStoreLocation "Cert:\LocalMachine\My" -KeyUsage DigitalSignature -Type CodeSigningCert -KeySpec Signature -NotAfter (Get-Date).AddDays(90) | |
$certPath = "Cert:\LocalMachine\My\$($cert.Thumbprint)" | |
$password = ConvertTo-SecureString -String "sparrow123" -Force -AsPlainText | |
Export-PfxCertificate -Cert $certPath -FilePath "D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\Certificate.pfx" -Password $password | |
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\SignTool.exe" sign /f "D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\Certificate.pfx" /p sparrow123 /tr http://timestamp.digicert.com /td sha256 /fd sha256 /v "D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\msi\*.msi" | |
- name: Download dmg file from Azure Blob Storage | |
run: | | |
az storage blob download --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} --container-name ${{ secrets.AZURE_CONTAINER_NAME }} --name Sparrow_1.1.0_x64.dmg --file D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\msi\Sparrow_1.1.0_x64.dmg --overwrite | |
az storage blob download --account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} --container-name ${{ secrets.AZURE_CONTAINER_NAME }} --name Sparrow.app.tar.gz --file D:\a\sparrow-app\sparrow-app\src-tauri\target\debug\bundle\msi\Sparrow.app.tar.gz --overwrite | |
env: | |
AZURE_STORAGE_ACCOUNT_NAME: ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} | |
AZURE_STORAGE_ACCOUNT_KEY: ${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }} | |
AZURE_CONTAINER_NAME: ${{ secrets.AZURE_CONTAINER_NAME }} | |
- name: Fetch Version from package.json | |
id: fetch-version | |
run: echo "::set-output name=version::$(jq -r .version package.json)" | |
- name: Semantic Release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }} | |