Skip to content

Update nymvpn-desktop.yml #101

Update nymvpn-desktop.yml

Update nymvpn-desktop.yml #101

name: "publish"
on:
push:
branches:
- main
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
working-directory: /nym-vpn/desktop
steps:
- name: try to fix windows path length
if: matrix.platform == 'windows-latest'
run: git config --system core.longpaths true
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: nymtech/nym
ref: feature/nymvpn-desktop
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 21
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: 1.73
#fix this
- name: install ubuntu dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update && sudo apt upgrade -y && sudo apt install build-essential \
pkg-config \
libgtk-3-dev \
libssl-dev \
libsoup2.4-dev \
libjavascriptcoregtk-4.0-dev \
libwebkit2gtk-4.0-dev \
libmnl-dev \
libnftnl-dev \
protobuf-compiler \
zip \
- name: install cargo dependencies
continue-on-error: true
run: |
cargo install cargo-deb
cargo install --force cargo-make
cargo install sd
cargo install ripgrep
cargo install cargo-about
cargo install cargo-generate-rpm
- name: install protobuf macos
continue-on-error: true
if: matrix.platform == 'macos-latest'
run: |
brew install protobuf
- name: install protobuf windows
if: matrix.platform == 'windows-latest'
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install protoc
- name: Add msbuild to PATH
if: matrix.platform == 'windows-latest'
uses: microsoft/[email protected]
- name: setup go
continue-on-error: true
uses: actions/setup-go@v4
with:
go-version: "stable"
- name: build ubuntu deb package
if: matrix.platform == 'ubuntu-latest'
run: cargo make deb
working-directory: .${{ env.working-directory }}
- name: Install the Apple certificate and provisioning profile
if: matrix.platform == 'macos-latest'
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_SIGNING_CERT_BASE64 }}
P12_PASSWORD: ${{ secrets.APPLE_SIGNING_CERT_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_PROVISIONING_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASS }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: build macos pkg
if: matrix.platform == 'macos-latest'
run: cargo make pkg
working-directory: .${{ env.working-directory }}
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}
APPLICATION_SIGNING_IDENTITY: 'Developer ID Application: Nym Technologies SA (VW5DZLFHM5)'
INSTALLER_SIGNING_IDENTITY: '3rd Party Mac Developer Installer: Nym Technologies SA (VW5DZLFHM5)'
- name: install arc windows
if: matrix.platform == 'windows-latest'
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install archiver
- name: Set path for candle and light
if: matrix.platform == 'windows-latest'
run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
shell: bash
- name: add signtool to path
if: matrix.platform == 'windows-latest'
run: |
curl -L https://github.com/Delphier/SignTool/releases/download/v10.0.22621.755/SignTool-10.0.22621.755.zip --output signtool.zip
arc unarchive signtool.zip ${{ github.workspace }}/nym-vpn/desktop
- name: Create env file
uses: timheuer/[email protected]
if: matrix.platform == 'windows-latest'
with:
fileName: "signing.pfx"
fileDir: ${{ github.workspace }}/nym-vpn/desktop
encodedString: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }}
- name: build windows installer
if: matrix.platform == 'windows-latest'
run: cargo make msi
working-directory: .${{ env.working-directory }}
env:
SIGN: true
CERT_FILE: 'signing.pfx'
CERT_FILE_PASSWORD: ${{ secrets.WINDOWS_SIGNING_PFX_PASSWORD }}
- uses: actions/upload-artifact@v3
if: matrix.platform == 'ubuntu-latest'
with:
name: nymvpn.deb
# need to make this not hardcoded to single version
path: ${{ github.workspace }}/nym-vpn/desktop/target/x86_64-unknown-linux-gnu/debian/nymvpn_0.0.2-1_amd64.deb