diff --git a/.github/workflows/build-nym-vpn-desktop-linux.yml b/.github/workflows/build-nym-vpn-desktop-linux.yml deleted file mode 100644 index 9a30dce10d..0000000000 --- a/.github/workflows/build-nym-vpn-desktop-linux.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: build-nym-vpn-desktop-linux -on: - workflow_dispatch: - workflow_call: - secrets: - TAURI_PRIVATE_KEY: - required: true - TAURI_KEY_PASSWORD: - required: true - DESKTOP_JS_SENTRY_DSN: - required: true - outputs: - UPLOAD_DIR_LINUX: - value: ${{ jobs.build-linux.outputs.UPLOAD_DIR_LINUX }} - PKG_VERSION: - value: ${{ jobs.build-linux.outputs.PKG_VERSION }} - RUST_VERSION: - value: ${{ jobs.build-linux.outputs.RUST_VERSION }} - -env: - CARGO_TERM_COLOR: always - CARGO_TARGET: release - WG_GO_LIB_PATH: ${{ github.workspace }}/lib - WG_GO_LIB_NAME: wireguard-go_ubuntu-22.04_x86_64 - UPDATER_BUNDLE_NAME: updater_linux_x86_64.AppImage.tar.gz - UPLOAD_DIR_LINUX: linux_artifacts - -jobs: - build-wireguard-go-linux: - uses: ./.github/workflows/build-wireguard-go-linux.yml - - build-linux: - needs: build-wireguard-go-linux - runs-on: arc-ubuntu-22.04 - outputs: - UPLOAD_DIR_LINUX: ${{ env.UPLOAD_DIR_LINUX }} - PKG_VERSION: ${{ steps.package-version.outputs.metadata }} - RUST_VERSION: ${{ steps.rust-version.outputs.rustc }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install system dependencies - run: | - sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools libayatana-appindicator3-dev make libfuse2 librsvg2-dev file - - - name: Install rust toolchain - uses: brndnmtthws/rust-action-rustup@v1 - with: - toolchain: stable - components: rustfmt, clippy - - - name: Install cargo-about - run: cargo install --locked cargo-about - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Get package version - id: package-version - uses: nicolaiunrein/cargo-get@master - with: - subcommand: package.version --entry nym-vpn-desktop/src-tauri - - - name: Download wireguard-go artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ env.WG_GO_LIB_NAME }} - path: ${{ env.WG_GO_LIB_PATH }} - - # - name: Generate licenses file (Js & Rust) and install JS dependencies - # working-directory: nym-vpn-desktop - # run: | - # npm i license-checker-rseidelsohn - # rm public/licenses-js.json || true - # npm run gen:licenses:js - # rm public/licenses-rust.json || true - # npm run gen:licenses:rust - # npm ci - - - name: Build desktop client - working-directory: nym-vpn-desktop/src-tauri - env: - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - APP_SENTRY_DSN: ${{ secrets.DESKTOP_JS_SENTRY_DSN }} - RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}" - run: | - npm ci - npm run tauri build --${{ env.CARGO_TARGET }} - ls -la target/release/ || true - ls -la target/release/bundle || true - ls -la target/release/bundle/* || true - - - name: Get rust version used for build - id: rust-version - run: | - echo "rustc=$(rustc -V)" >> $GITHUB_OUTPUT - - - name: Move things around to prepare for upload - env: - SRC_APPIMAGE: nym-vpn-desktop/src-tauri/target/release/bundle/appimage/nym-vpn_${{ steps.package-version.outputs.metadata }}_amd64.AppImage - SRC_DEB: nym-vpn-desktop/src-tauri/target/release/bundle/deb/nym-vpn_${{ steps.package-version.outputs.metadata }}_amd64.deb - run: | - mkdir ${{ env.UPLOAD_DIR_LINUX }} - echo "Move AppImage" - cp -vpr ${{ env.SRC_APPIMAGE }} ${{ env.UPLOAD_DIR_LINUX }} - echo "Move updater bundle and signature" - cp -vpr ${{ env.SRC_APPIMAGE }}.tar.gz ${{ env.UPLOAD_DIR_LINUX }}/${{ env.UPDATER_BUNDLE_NAME }} - cp -vpr ${{ env.SRC_APPIMAGE }}.tar.gz.sig ${{ env.UPLOAD_DIR_LINUX }}/${{ env.UPDATER_BUNDLE_NAME }}.sig - echo "Move debian pkg" - cp -vpr ${{ env.SRC_DEB }} ${{ env.UPLOAD_DIR_LINUX }} - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ env.UPLOAD_DIR_LINUX }} - path: ${{ env.UPLOAD_DIR_LINUX }} - retention-days: 1 diff --git a/.github/workflows/build-nym-vpn-desktop-mac.yml b/.github/workflows/build-nym-vpn-desktop-mac.yml deleted file mode 100644 index 1f4eeeebbe..0000000000 --- a/.github/workflows/build-nym-vpn-desktop-mac.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: build-nym-vpn-desktop-mac -on: - workflow_dispatch: - workflow_call: - secrets: - TAURI_PRIVATE_KEY: - required: true - TAURI_KEY_PASSWORD: - required: true - DESKTOP_JS_SENTRY_DSN: - required: true - APPLE_DEVELOPER_ID_APPLICATION_CERT: - required: true - APPLE_DEVELOPER_ID_APPLICATION_CERT_PASS: - required: true - APPLE_SIGNING_IDENTITY: - required: true - APPLE_ID: - required: true - APPLE_ID_PASSWORD: - required: true - APPLE_TEAM_ID: - required: true - outputs: - UPLOAD_DIR_MAC: - value: ${{ jobs.build-mac.outputs.UPLOAD_DIR_MAC }} - -env: - CARGO_TERM_COLOR: always - CARGO_TARGET: release - WG_GO_LIB_PATH: ${{ github.workspace }}/lib - WG_GO_LIB_NAME: wireguard-go_apple_universal - UPLOAD_DIR_MAC: mac_artifacts - TAURI_SRC: '${{ github.workspace }}/nym-vpn-desktop/src-tauri/' - -jobs: - build-wireguard-go-mac: - uses: ./.github/workflows/build-wireguard-go-mac.yml - - build-mac: - needs: build-wireguard-go-mac - runs-on: macos-14 - outputs: - UPLOAD_DIR_MAC: ${{ env.UPLOAD_DIR_MAC }} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install rust toolchain - uses: brndnmtthws/rust-action-rustup@v1 - with: - toolchain: stable - components: rustfmt, clippy - - - name: Install x86_64-apple-darwin target for universal build - run: | - rustup target add x86_64-apple-darwin - - - name: Install cargo-about - run: | - cargo install --locked cargo-about - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Get package version - id: package-version - uses: nicolaiunrein/cargo-get@master - with: - subcommand: package.version --entry nym-vpn-desktop/src-tauri - - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Download wireguard-go artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ env.WG_GO_LIB_NAME }} - path: ${{ env.WG_GO_LIB_PATH }} - - # - name: Generate licenses file (Js & Rust) and install JS dependencies - # working-directory: nym-vpn-desktop - # run: | - # npm i license-checker-rseidelsohn - # rm public/licenses-js.json || true - # npm run gen:licenses:js - # rm public/licenses-rust.json || true - # npm run gen:licenses:rust - # npm ci - - - name: Build desktop client - working-directory: nym-vpn-desktop/src-tauri - env: - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - APP_SENTRY_DSN: ${{ secrets.DESKTOP_JS_SENTRY_DSN }} - RUSTFLAGS: "-L ${{ env.WG_GO_LIB_PATH }}" - # Apple stuff - APPLE_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERT }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERT_PASS }} - APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - # TODO try fixing `error running bundle_dmg.sh` (macos build) - NO_STRIP: 'true' - run: | - npm ci - npm run tauri build --${{ env.CARGO_TARGET }} -- --target universal-apple-darwin - ls -la target/ || true - ls -la target/release/ || true - ls -la target/release/bundle || true - ls -la target/release/bundle/* || true - ls -la target/universal-apple-darwin/release/ || true - ls -la target/universal-apple-darwin/release/bundle || true - ls -la target/universal-apple-darwin/release/bundle/* || true - - - name: Move things around to prepare for upload - env: - MAC_UPDATER: ${{ env.TAURI_SRC }}/target/universal-apple-darwin/release/bundle/macos/nym-vpn.app.tar.gz - MAC_UPDATER_NAME: updater_macos_universal.app.tar.gz - BINARY: ${{ env.TAURI_SRC }}/target/universal-apple-darwin/release/bundle/dmg/nym-vpn_${{ steps.package-version.outputs.metadata }}_universal.dmg - run: | - echo "moving binaries into ${{ env.UPLOAD_DIR_MAC }}" - rm -rf ${{ env.UPLOAD_DIR_MAC }} || true - mkdir ${{ env.UPLOAD_DIR_MAC }} - cp -vpr '${{ env.MAC_UPDATER }}' ${{ env.UPLOAD_DIR_MAC }}/${MAC_UPDATER_NAME} - cp -vpr '${{ env.MAC_UPDATER }}.sig' ${{ env.UPLOAD_DIR_MAC }}/${MAC_UPDATER_NAME}.sig - cp -vpr '${{ env.BINARY }}' ${{ env.UPLOAD_DIR_MAC }}/ - - - name: Upload artifact mac - uses: actions/upload-artifact@v4 - with: - name: ${{ env.UPLOAD_DIR_MAC }} - path: ${{ env.UPLOAD_DIR_MAC }} - retention-days: 1 diff --git a/.github/workflows/build-nym-vpn-desktop-windows.yml b/.github/workflows/build-nym-vpn-desktop-windows.yml deleted file mode 100644 index 03572239c8..0000000000 --- a/.github/workflows/build-nym-vpn-desktop-windows.yml +++ /dev/null @@ -1,166 +0,0 @@ -name: build-nym-vpn-desktop-windows -on: - workflow_dispatch: - workflow_call: - secrets: - WINDOWS_SIGNING_PFX_BASE64: - required: true - WINDOWS_SIGNING_PFX_PASSWORD: - required: true - TAURI_PRIVATE_KEY: - required: true - TAURI_KEY_PASSWORD: - required: true - DESKTOP_JS_SENTRY_DSN: - required: true - outputs: - UPLOAD_DIR_WINDOWS: - value: ${{ jobs.build-windows.outputs.UPLOAD_DIR_WINDOWS }} - -env: - CARGO_TERM_COLOR: always - CARGO_TARGET: release - LIBS_PATH: '${{ github.workspace }}/lib' - WG_GO_LIB_NAME: wireguard-go_x86_64-pc-windows-msvc - MULLVAD_LIB_NAME: winfw - UPLOAD_DIR_WINDOWS: windows_artifacts - TAURI_SRC: '${{ github.workspace }}/nym-vpn-desktop/src-tauri/' - -jobs: - build-wireguard-go-windows: - uses: ./.github/workflows/build-wireguard-go-windows.yml - - build-mullvad-windows: - uses: ./.github/workflows/build-mullvad-windows.yml - - build-windows: - needs: [build-wireguard-go-windows,build-mullvad-windows] - runs-on: custom-windows-11 - env: - CPP_BUILD_MODES: ${{ needs.build-mullvad-windows.outputs.CPP_BUILD_MODES }} - outputs: - UPLOAD_DIR_WINDOWS: ${{ env.UPLOAD_DIR_WINDOWS }} - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v2 - - - name: Install rust toolchain - uses: brndnmtthws/rust-action-rustup@v1 - with: - toolchain: stable - components: rustfmt, clippy - - - name: Install cargo-about - run: cargo install --locked cargo-about - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Get package version - id: package-version - uses: nicolaiunrein/cargo-get@master - with: - subcommand: package.version --entry nym-vpn-desktop/src-tauri - - - name: Download wireguard-go-windows artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ env.WG_GO_LIB_NAME }} - path: ${{ env.LIBS_PATH }}/ - - - name: Download mullvad lib artifact (winfw.lib) - uses: actions/download-artifact@v4 - with: - name: ${{ env.MULLVAD_LIB_NAME }}.lib - path: ${{ env.TAURI_SRC }}/ - - - name: Download mullvad lib artifact (winfw.lib) - uses: actions/download-artifact@v4 - with: - name: ${{ env.MULLVAD_LIB_NAME }}.dll - path: ${{ env.TAURI_SRC }}/ - - - name: Download/Unzip/Move wintun.zip, winpcap.zip also move wireguard lib for windows - shell: bash - run: | - curl --output ${GITHUB_WORKSPACE}/wintun.zip https://www.wintun.net/builds/wintun-0.14.1.zip - curl --output ${GITHUB_WORKSPACE}/winpcap.zip https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip - unzip ${GITHUB_WORKSPACE}/wintun.zip - unzip ${GITHUB_WORKSPACE}/winpcap.zip - mv ${GITHUB_WORKSPACE}/wintun/bin/amd64/wintun.dll '${{ env.TAURI_SRC }}' - mv ${GITHUB_WORKSPACE}/WpdPack/Lib/x64/Packet.lib '${{ env.TAURI_SRC }}' - mv '${{ env.LIBS_PATH }}/libwg.dll' '${{ env.TAURI_SRC }}' - mv '${{ env.LIBS_PATH }}/libwg.lib' '${{ env.TAURI_SRC }}' - - - - name: Install Protoc - uses: arduino/setup-protoc@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - # - name: Generate licenses file (Js & Rust) and install JS dependencies - # working-directory: nym-vpn-desktop - # shell: bash - # run: | - # npm i license-checker-rseidelsohn - # rm public/licenses-js.json || true - # npm run gen:licenses:js - # rm public/licenses-rust.json || true - # npm run gen:licenses:rust - # npm ci - - - name: Import signing certificate - env: - WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }} - WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_SIGNING_PFX_PASSWORD }} - run: | - New-Item -ItemType directory -Path certificate - Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE - certutil -decode certificate/tempCert.txt certificate/certificate.pfx - Remove-Item -path certificate -include tempCert.txt - Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText) - - - name: Build desktop client - working-directory: nym-vpn-desktop/src-tauri - shell: bash - env: - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - APP_SENTRY_DSN: ${{ secrets.DESKTOP_JS_SENTRY_DSN }} - RUSTFLAGS: "-L ${{ env.TAURI_SRC }}/x86_64-pc-windows-msvc -L ${{ env.TAURI_SRC }} -Clink-args=/LIBPATH:${{ env.TAURI_SRC }}/x64-${{ env.CPP_BUILD_MODES }}" - WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }} - WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_SIGNING_PFX_PASSWORD }} - run: | - sed -i 's/"bundle": {/"bundle": {"resources": ["wintun.dll", "vcruntime140.dll", "libwg.dll", "winfw.dll"],/g' '${{ env.TAURI_SRC }}/tauri.conf.json' - npm ci - npm run tauri build --${{ env.CARGO_TARGET }} - ls -la target/release/ || true - ls -la target/release/bundle || true - ls -la target/release/bundle/* || true - - - name: Move things around to prepare for upload - shell: bash - env: - WINDOWS_BUILT_NAME: ${{ env.TAURI_SRC }}/target/release/bundle/nsis/nym-vpn_${{ steps.package-version.outputs.metadata }}_x64-setup.nsis.zip - WINDOWS_UPDATER_NAME: updater_windows_x86_64.nsis.zip - BINARY: ${{ env.TAURI_SRC }}/target/release/bundle/nsis/nym-vpn_${{ steps.package-version.outputs.metadata }}_x64-setup.exe - run: | - echo "moving binaries into ${{ env.UPLOAD_DIR_WINDOWS }}" - rm -rf ${{ env.UPLOAD_DIR_WINDOWS }} || true - mkdir ${{ env.UPLOAD_DIR_WINDOWS }} - cp -vpr '${{ env.WINDOWS_BUILT_NAME }}' ${{ env.UPLOAD_DIR_WINDOWS }}/${WINDOWS_UPDATER_NAME} - cp -vpr '${{ env.WINDOWS_BUILT_NAME }}.sig' ${{ env.UPLOAD_DIR_WINDOWS }}/${WINDOWS_UPDATER_NAME}.sig - cp -vpr '${{ env.BINARY }}' ${{ env.UPLOAD_DIR_WINDOWS }}/ - - - name: Upload artifact windows - uses: actions/upload-artifact@v4 - with: - name: ${{ env.UPLOAD_DIR_WINDOWS }} - path: ${{ env.UPLOAD_DIR_WINDOWS }} - retention-days: 1 diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 815e6ed7cc..c251cfb894 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -8,27 +8,33 @@ jobs: runs-on: ubuntu-latest outputs: is_admin: ${{ steps.check.outputs.is_admin }} - steps: - name: Check if user has admin access id: check run: | - user_role=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission" \ - | jq -r '.permission') + user_role=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission") + permission=$(echo "$user_role" | jq -r '.permission') - if [ "$user_role" == "admin" ]; then + if [ "$permission" == "admin" ]; then echo "User ${{ github.actor }} is an admin." - echo "is_admin=true" >> $GITHUB_ENV + echo "is_admin=true" >> "$GITHUB_OUTPUT" else echo "User ${{ github.actor }} is not an admin." - echo "is_admin=false" >> $GITHUB_ENV + echo "is_admin=false" >> "$GITHUB_OUTPUT" + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - create_release: + set_release_version_and_create_branch: + needs: check_admin_permission + outputs: + branch_name: ${{ steps.create_branch.outputs.branch_name }} if: needs.check_admin_permission.outputs.is_admin == 'true' runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout Repository @@ -39,51 +45,88 @@ jobs: git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" - - name: Create a new branch + - name: Setup branch name id: create_branch run: | BRANCH_NAME="release-nym-vpn-core-$(date +'%Y%m%d%H%M%S')" git checkout -b $BRANCH_NAME - echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV + echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT - - name: Run release script + - name: Install cargo-edit, cargo-get run: | - ./scripts/create-nym-vpn-core-release.sh + cargo install --locked cargo-edit cargo-get - - name: Run bump to dev version script + - name: Run create-nym-vpn-core-release.sh run: | - ./scripts/bump-nym-vpn-core-to-next-dev-version.sh + ./scripts/create-nym-vpn-core-release.sh --yes - # - name: Commit bumped version - # run: | - # git add . - # git commit -m "Bump version to next dev version" - # git push origin ${{ env.branch_name }} + - name: Push commit with version bump to new branch + run: | + git push origin HEAD:${{ steps.create_branch.outputs.branch_name }} - - name: Open a Pull Request - uses: peter-evans/create-pull-request@v7 + update_nym_vpn_apple: + needs: set_release_version_and_create_branch + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 with: - branch: ${{ env.branch_name }} - title: "Release: ${{ env.branch_name }}" - body: "Automated PR for the release." + ref: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} + + - name: Set up Git user + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Cache cargo packages + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - # - name: Push the new branch and tags - # run: | - # git push origin ${{ env.branch_name }} - # git push --tags - - # - name: Commit and push the bumped version - # run: | - # git add . - # git commit -m "Bump version to next dev version" - # git push origin ${{ env.branch_name }} - - # - name: Update PR with bumped version - # uses: peter-evans/create-pull-request@v7 - # with: - # branch: ${{ env.branch_name }} - # title: "Release: ${{ env.branch_name }} (Bumped)" - # body: "Automated PR with the bumped version." - # committer: "GitHub " - # author: "GitHub Actions " + - name: Install cargo-edit, cargo-get + run: | + cargo install --locked cargo-edit cargo-get + - name: Run update-nym-vpn-apple-to-latest-core.sh + run: | + ./scripts/update-nym-vpn-apple-to-latest-core.sh + git diff + git commit -a -m "Update Info.plist" + git push origin HEAD:${{ needs.set_release_version_and_create_branch.outputs.branch_name }} + + bump_to_dev_version_and_create_pull_request: + needs: [set_release_version_and_create_branch, update_nym_vpn_apple] + if: needs.check_admin_permission.outputs.is_admin == 'true' + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} + + - name: Set up Git user + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Install cargo-edit, cargo-get + run: | + cargo install --locked cargo-edit cargo-get + + - name: Run bump-nym-vpn-core-to-next-dev-version.sh + run: | + ./scripts/bump-nym-vpn-core-to-next-dev-version.sh --yes + + - name: Create PR + uses: peter-evans/create-pull-request@v7 + with: + branch: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} + title: "Release: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }}" + body: "Automated PR for the release." + base: "main" + draft: true diff --git a/.github/workflows/generate-build-info-desktop.yml b/.github/workflows/generate-build-info-desktop.yml deleted file mode 100644 index b06f2d6fc7..0000000000 --- a/.github/workflows/generate-build-info-desktop.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: generate-build-info-desktop -on: - workflow_dispatch: - workflow_call: - inputs: - build-profile: - description: "Rust build profile" - required: true - default: Release - type: string - rust-version: - description: "Rust version" - required: true - type: string - -jobs: - generate-build-info-desktop: - runs-on: arc-ubuntu-22.04 - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install yq - run: | - sudo wget https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 -O /usr/bin/yq - sudo chmod +x /usr/bin/yq - - - name: Get current date - id: date - run: - echo "date=$(date)" >> $GITHUB_OUTPUT - - - name: Generate build-info - run: | - touch build-info.txt - echo "App name: $(yq -oy '.productName' nym-vpn-desktop/src-tauri/tauri.conf.json)" >> build-info.txt - echo "Version: $(yq -oy '.package.version' nym-vpn-desktop/src-tauri/Cargo.toml)" >> build-info.txt - echo "Tauri version: $(yq -oy '.dependencies.tauri.version' nym-vpn-desktop/src-tauri/Cargo.toml)" >> build-info.txt - echo "Rustc version: ${{ inputs.rust-version}}" >> build-info.txt - echo "Build profile: ${{ inputs.build-profile}}" >> build-info.txt - echo "Date: ${{ steps.date.outputs.date }}" >> build-info.txt - cat build-info.txt - - - name: Upload build-info - uses: actions/upload-artifact@v4 - with: - name: build-info - path: build-info.txt - retention-days: 1 diff --git a/.github/workflows/publish-nym-vpn-desktop.yml b/.github/workflows/publish-nym-vpn-desktop.yml deleted file mode 100644 index 0654c1d74f..0000000000 --- a/.github/workflows/publish-nym-vpn-desktop.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: publish-nym-vpn-desktop -on: - workflow_dispatch: - inputs: - tag_name: - description: "Tag name for release" - required: false - default: nightly-desktop - publish: - type: boolean - description: Publish Release - required: true - default: false - push: - tags: - - nym-vpn-desktop-v[0-9]+.[0-9]+.[0-9]+* - -jobs: - build-nym-vpn-desktop-linux: - uses: ./.github/workflows/build-nym-vpn-desktop-linux.yml - secrets: inherit - build-nym-vpn-desktop-mac: - uses: ./.github/workflows/build-nym-vpn-desktop-mac.yml - secrets: inherit - build-nym-vpn-desktop-windows: - uses: ./.github/workflows/build-nym-vpn-desktop-windows.yml - secrets: inherit - - generate-build-info-desktop: - uses: ./.github/workflows/generate-build-info-desktop.yml - needs: build-nym-vpn-desktop-linux - with: - build-profile: release - rust-version: ${{ needs.build-nym-vpn-desktop-linux.outputs.RUST_VERSION }} - - publish: - needs: - - build-nym-vpn-desktop-linux - - build-nym-vpn-desktop-mac - - build-nym-vpn-desktop-windows - - generate-build-info-desktop - runs-on: arc-ubuntu-22.04 - outputs: - tag: ${{ steps.set_tag.outputs.tag }} - env: - # GH needed for gh cli - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PKG_VERSION: ${{ needs.build-nym-vpn-desktop-linux.outputs.PKG_VERSION }} - UPLOAD_DIR_LINUX: ${{ needs.build-nym-vpn-desktop-linux.outputs.UPLOAD_DIR_LINUX }} - UPLOAD_DIR_MAC: ${{ needs.build-nym-vpn-desktop-mac.outputs.UPLOAD_DIR_MAC }} - UPLOAD_DIR_WINDOWS: ${{ needs.build-nym-vpn-desktop-windows.outputs.UPLOAD_DIR_WINDOWS }} - permissions: write-all - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - # Adding envsubst, gh cli - - name: Install system dependencies - run: | - sudo apt update && sudo apt install -y gettext-base gh - - - name: Install rust toolchain - uses: brndnmtthws/rust-action-rustup@v1 - with: - toolchain: stable - components: rustfmt, clippy - - - name: Get package version - id: package-version - uses: nicolaiunrein/cargo-get@master - with: - subcommand: package.version --entry nym-vpn-desktop/src-tauri - - - name: Check tag name consistency - if: github.event_name == 'push' - shell: bash - run: | - if [[ nym-vpn-desktop-v${{ steps.package-version.outputs.metadata }} != ${{ github.ref_name }} ]]; then - exit 1 - fi - - - name: Download artifacts - uses: actions/download-artifact@v4 - - # Setup TAG_NAME, which is used as a general "name" - - if: github.event_name == 'workflow_dispatch' - run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV - - if: github.event_name == 'schedule' - run: echo "TAG_NAME=nightly-desktop" >> $GITHUB_ENV - - if: github.event_name == 'push' - run: echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV - - - name: Set tag - id: set_tag - run: echo "tag=${{ env.TAG_NAME }}" >> "$GITHUB_OUTPUT" - - - name: Setting subject, prerelease and notes files - if: ${{ contains(env.TAG_NAME, 'nightly-desktop') }} - run: | - (echo "SUBJECT=nym-vpn-desktop-v${{ steps.package-version.outputs.metadata }} nightly prerelease build"; - echo 'PRERELEASE=--prerelease'; - echo 'NOTES_FILE=release-notes/release-notes-desktop-nightly.md') >> $GITHUB_ENV - gh release delete nightly-desktop --yes || true - git push origin :nightly-desktop || true - - # Once we consider these actually release builds, remove --prerelease - # from PRERELEASE here - - name: Removing --prerelease if needed - if: ${{ !contains(env.TAG_NAME, 'nightly-desktop') }} - run: | - (echo "SUBJECT=$TAG_NAME" - echo 'PRERELEASE=' - echo 'NOTES_FILE=release-notes/release-notes-desktop.md') >> $GITHUB_ENV - - - name: Generate checksums - run: | - for f in ${{ env.UPLOAD_DIR_LINUX}}/*; do sha256sum ${f} > ${f}.sha256sum; done - for f in ${{ env.UPLOAD_DIR_MAC}}/*; do sha256sum ${f} > ${f}.sha256sum; done - for f in ${{ env.UPLOAD_DIR_WINDOWS}}/*; do sha256sum ${f} > ${f}.sha256sum; done - echo 'SHA256_CHECKSUMS<> $GITHUB_ENV - cat ${{ env.UPLOAD_DIR_LINUX}}/*.sha256sum >> $GITHUB_ENV - cat ${{ env.UPLOAD_DIR_MAC}}/*.sha256sum >> $GITHUB_ENV - cat ${{ env.UPLOAD_DIR_WINDOWS}}/*.sha256sum >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - - name: AppImage installer bump version - env: - appimg_installer: nym-vpn-desktop/scripts/appimage.sh - run: | - echo "tag: $TAG_NAME" - echo "version: $PKG_VERSION" - sed -i "s/^tag=.*$/tag=$TAG_NAME/" $appimg_installer - sed -i "s/^version=.*$/version=$PKG_VERSION/" $appimg_installer - mkdir installer - cp -v $appimg_installer installer - - - name: Build info - run: | - echo 'BUILD_INFO<> $GITHUB_ENV - cat build-info/build-info.txt >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - - name: Publish release - run: | - echo "build info" - echo "$BUILD_INFO" - echo "checksums" - echo "$SHA256_CHECKSUMS" - echo "Creating release notes" - envsubst < "$GITHUB_WORKSPACE/.github/workflows/$NOTES_FILE" > "$RUNNER_TEMP/release-notes.md" - echo "Creating release nodes: output" - cat $RUNNER_TEMP/release-notes.md - echo "Creating release" - echo gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/release-notes.md" --title "$SUBJECT" --target $GITHUB_SHA ${{ env.UPLOAD_DIR_LINUX}}/* ${{ env.UPLOAD_DIR_MAC}}/* ${{ env.UPLOAD_DIR_WINDOWS}}/* installer/* - gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/release-notes.md" --title "$SUBJECT" --target $GITHUB_SHA ${{ env.UPLOAD_DIR_LINUX}}/* ${{ env.UPLOAD_DIR_MAC}}/* ${{ env.UPLOAD_DIR_WINDOWS}}/* installer/* - - gen-hashes: - uses: ./.github/workflows/gen-hashes-json.yml - needs: publish - with: - release_tag: ${{ needs.publish.outputs.tag }} - secrets: inherit diff --git a/.github/workflows/release-notes/release-notes-desktop-nightly.md b/.github/workflows/release-notes/release-notes-desktop-nightly.md deleted file mode 100644 index 6bb0439e30..0000000000 --- a/.github/workflows/release-notes/release-notes-desktop-nightly.md +++ /dev/null @@ -1,13 +0,0 @@ -``` -${BUILD_INFO} -``` - -## Notes - -Nightly build of the latest development version of the desktop client. - -## SHA256 Checksums - -``` -${SHA256_CHECKSUMS} -``` diff --git a/.github/workflows/release-notes/release-notes-desktop.md b/.github/workflows/release-notes/release-notes-desktop.md deleted file mode 100644 index 5bc9c46151..0000000000 --- a/.github/workflows/release-notes/release-notes-desktop.md +++ /dev/null @@ -1,27 +0,0 @@ -``` -${BUILD_INFO} -``` - -## Notes - -Release build. - -### Linux - -- `deb` package suitable for Debian and Ubuntu -- AppImage bundle that should be compatible with most Linux distributions - -### Mac - -- Universal binary for both Intel and ARM architectures - -### Windows - -- Desktop client for Windows -- Run as administrator - -## SHA256 Checksums - -``` -${SHA256_CHECKSUMS} -``` diff --git a/scripts/bump-nym-vpn-app-to-next-dev-version.sh b/scripts/bump-nym-vpn-app-to-next-dev-version.sh index 4bb26f5081..faf8af5f0d 100755 --- a/scripts/bump-nym-vpn-app-to-next-dev-version.sh +++ b/scripts/bump-nym-vpn-app-to-next-dev-version.sh @@ -53,6 +53,7 @@ run_npm_set_version() { main() { check_unstaged_changes confirm_root_directory + check_cargo_utils_installed local version=$(get_current_cargo_version) local next_version=$(increment_version "$version") diff --git a/scripts/bump-nym-vpn-core-to-next-dev-version.sh b/scripts/bump-nym-vpn-core-to-next-dev-version.sh index 7603e06be7..007ef9ca5e 100755 --- a/scripts/bump-nym-vpn-core-to-next-dev-version.sh +++ b/scripts/bump-nym-vpn-core-to-next-dev-version.sh @@ -22,6 +22,20 @@ for arg in "$@"; do esac done +# Check if cargo set-version is installed +if cargo set-version --help >/dev/null 2>&1; then + echo "cargo set-version is installed." +else + echo "cargo set-version is not installed. Please install it by running 'cargo install --locked cargo-get'" +fi + +# Check if cargo-get is installed +if cargo get --help >/dev/null 2>&1; then + echo "cargo-get is installed." +else + echo "cargo-get is not installed. Please install it by running 'cargo install --locked cargo-get'." +fi + get_current_version() { echo "$(cargo get workspace.package.version)" } @@ -43,6 +57,8 @@ run_cargo_set_version() { main() { check_unstaged_changes confirm_root_directory + check_cargo_utils_installed + cd $DIRNAME local version=$(get_current_version) local next_version=$(increment_version "$version") diff --git a/scripts/common.sh b/scripts/common.sh index 2798d22e30..09b1e45a3b 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -106,3 +106,21 @@ increment_version() { echo "$new_version" } + +check_cargo_utils_installed() { + # Check if cargo set-version is installed + if cargo set-version --help >/dev/null 2>&1; then + echo "cargo set-version is installed." + else + echo "cargo set-version is not installed. Please install it by running 'cargo install --locked cargo-get'" + exit 1 + fi + + # Check if cargo-get is installed + if cargo get --help >/dev/null 2>&1; then + echo "cargo-get is installed." + else + echo "cargo-get is not installed. Please install it by running 'cargo install --locked cargo-get'." + exit 1 + fi +} diff --git a/scripts/create-nym-vpn-app-release.sh b/scripts/create-nym-vpn-app-release.sh index 40d73ef2b5..c436f89d8b 100755 --- a/scripts/create-nym-vpn-app-release.sh +++ b/scripts/create-nym-vpn-app-release.sh @@ -55,6 +55,7 @@ tag_release() { main() { check_unstaged_changes confirm_root_directory + check_cargo_utils_installed cargo_version_bump npm_version_bump tag_release diff --git a/scripts/create-nym-vpn-core-release.sh b/scripts/create-nym-vpn-core-release.sh index 7fda800473..5cf5ed4874 100755 --- a/scripts/create-nym-vpn-core-release.sh +++ b/scripts/create-nym-vpn-core-release.sh @@ -32,6 +32,20 @@ for arg in "$@"; do esac done +# Check if cargo set-version is installed +if cargo set-version --help >/dev/null 2>&1; then + echo "cargo set-version is installed." +else + echo "cargo set-version is not installed. Please install it by running 'cargo install --locked cargo-get'" +fi + +# Check if cargo-get is installed +if cargo get --help >/dev/null 2>&1; then + echo "cargo-get is installed." +else + echo "cargo-get is not installed. Please install it by running 'cargo install --locked cargo-get'." +fi + cargo_version_bump() { cd $DIRNAME local package_flags="-p $PACKAGE" @@ -53,6 +67,7 @@ tag_release() { main() { check_unstaged_changes confirm_root_directory + check_cargo_utils_installed cargo_version_bump tag_release } diff --git a/scripts/update-nym-vpn-apple-to-latest-core.sh b/scripts/update-nym-vpn-apple-to-latest-core.sh index ac10ccdd58..6f6b24d324 100755 --- a/scripts/update-nym-vpn-apple-to-latest-core.sh +++ b/scripts/update-nym-vpn-apple-to-latest-core.sh @@ -37,6 +37,7 @@ update_daemon_version_on_mac() { main() { check_unstaged_changes confirm_root_directory + check_cargo_utils_installed local core_version=$(cargo get --entry nym-vpn-core workspace.package.version) update_daemon_version_on_mac $core_version