Update nymvpn-desktop.yml #123
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: "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 developer certificate for code signing | ||
if: matrix.platform == 'macos-latest' | ||
env: | ||
APPLE_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_INSTALLER_PRIVATE_KEY }} | ||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_INSTALLER_PRIVATE_KEY_PASSWORD }} | ||
APPLE_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }} | ||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASS }} | ||
run: | | ||
CERTIFICATE_PATH = $RUNNER_TEMP/build_certificate.p12 | ||
KEYCHAIN_PATH = $RUNNER_TEMP/app-signing.keychain-db | ||
echo -n "$APPLE_CERTIFICATE" | base64 --decode -o $CERTIFICATE_PATH | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
- 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 }} | ||
KEYCHAIN_PATH: ${{ runner.temp }}/app-signing.keychain-db | ||
APPLICATION_SIGNING_IDENTITY: ${{ secrets.APPLE_DEVELOPER_IDENTITY_ID }} | ||
INSTALLER_SIGNING_IDENTITY: ${{ secrets.INSTALLER_SIGNING_IDENTITY }} | ||
- 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 |