From 7641abb6d58472f3ee6c6959d2e47e6350bc2b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 06:12:27 +0200 Subject: [PATCH 01/17] Add step to update Info.plist --- .github/workflows/create-release-nym-vpn-core.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 815e6ed7cc..55b37acc46 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -42,17 +42,24 @@ jobs: - name: Create a new branch id: create_branch run: | - BRANCH_NAME="release-nym-vpn-core-$(date +'%Y%m%d%H%M%S')" + 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 - name: Run release script run: | - ./scripts/create-nym-vpn-core-release.sh + ./scripts/create-nym-vpn-core-release.sh --yes + + - name: Update nym-vpn-apple to latest core + run: | + ./scripts/update-nym-vpn-apple-to-latests-core.sh + git diff + git add -u + git commit -m "Update Info.plist" - name: Run bump to dev version script run: | - ./scripts/bump-nym-vpn-core-to-next-dev-version.sh + ./scripts/bump-nym-vpn-core-to-next-dev-version.sh --yes # - name: Commit bumped version # run: | From 92164656a0ac55d0ada9c2953b3e76242ed1958d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 06:52:28 +0200 Subject: [PATCH 02/17] update --- .../workflows/create-release-nym-vpn-core.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 55b37acc46..670be3d321 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -23,12 +23,16 @@ jobs: else echo "User ${{ github.actor }} is not an admin." echo "is_admin=false" >> $GITHUB_ENV + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} create_release: if: needs.check_admin_permission.outputs.is_admin == 'true' runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: Checkout Repository @@ -39,25 +43,24 @@ 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 + # git checkout -b $BRANCH_NAME echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV - - name: Run release script + - name: Run create-nym-vpn-core-release.sh run: | ./scripts/create-nym-vpn-core-release.sh --yes - - name: Update nym-vpn-apple to latest core + - name: Run update-nym-vpn-apple-to-latests-core.sh run: | ./scripts/update-nym-vpn-apple-to-latests-core.sh git diff - git add -u - git commit -m "Update Info.plist" + git commit -a -m "Update Info.plist" - - name: Run bump to dev version script + - name: Run bump-nym-vpn-core-to-next-dev-version.sh run: | ./scripts/bump-nym-vpn-core-to-next-dev-version.sh --yes @@ -73,6 +76,7 @@ jobs: branch: ${{ env.branch_name }} title: "Release: ${{ env.branch_name }}" body: "Automated PR for the release." + draft: true # - name: Push the new branch and tags # run: | From 63c3cf7974b17566e5ada8891c64d57486a2e93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:03:26 +0200 Subject: [PATCH 03/17] admin check --- .github/workflows/create-release-nym-vpn-core.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 670be3d321..8863c14ecc 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -13,9 +13,10 @@ jobs: - 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") + echo "$user_role" + permission=$(echo "$user_role" | jq -r '.permission') if [ "$user_role" == "admin" ]; then echo "User ${{ github.actor }} is an admin." From ac349c4f842ed2e86f6f316c84a32a1cc7d102bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:06:15 +0200 Subject: [PATCH 04/17] typo --- .github/workflows/create-release-nym-vpn-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 8863c14ecc..73fb5c6e59 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -18,7 +18,7 @@ jobs: echo "$user_role" 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 else From 066a87868e88a94da7486c97d4fcd4869fe5862c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:18:52 +0200 Subject: [PATCH 05/17] Fix wf --- .github/workflows/create-release-nym-vpn-core.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 73fb5c6e59..5201a703d2 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -8,7 +8,6 @@ jobs: runs-on: ubuntu-latest outputs: is_admin: ${{ steps.check.outputs.is_admin }} - steps: - name: Check if user has admin access id: check @@ -20,15 +19,16 @@ jobs: 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: + needs: check_admin_permission if: needs.check_admin_permission.outputs.is_admin == 'true' runs-on: ubuntu-latest permissions: From 9134c2bd8dcb855ae5e8336907d87a64852a7aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:24:03 +0200 Subject: [PATCH 06/17] Install cargo-edit --- .github/workflows/create-release-nym-vpn-core.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 5201a703d2..09adf504e0 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -51,6 +51,10 @@ jobs: # git checkout -b $BRANCH_NAME echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV + - name: Install cargo-edit + run: | + cargo install --locked cargo-edit + - name: Run create-nym-vpn-core-release.sh run: | ./scripts/create-nym-vpn-core-release.sh --yes From 2e1e7914303334e8d8885fc02a5fa72bb057b4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:28:24 +0200 Subject: [PATCH 07/17] Install cargo-get --- .github/workflows/create-release-nym-vpn-core.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 09adf504e0..cbed87e8e6 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -51,9 +51,9 @@ jobs: # git checkout -b $BRANCH_NAME echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV - - name: Install cargo-edit + - name: Install cargo-edit, cargo-get run: | - cargo install --locked cargo-edit + cargo install --locked cargo-edit cargo-get - name: Run create-nym-vpn-core-release.sh run: | From 9df03ba380117299f049a44602c315d287296f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:33:55 +0200 Subject: [PATCH 08/17] typo --- .github/workflows/create-release-nym-vpn-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index cbed87e8e6..c1fe4d6cef 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -61,7 +61,7 @@ jobs: - name: Run update-nym-vpn-apple-to-latests-core.sh run: | - ./scripts/update-nym-vpn-apple-to-latests-core.sh + ./scripts/update-nym-vpn-apple-to-latest-core.sh git diff git commit -a -m "Update Info.plist" From d39d1ba925f1d9bf8b6736674548c982688df6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 07:46:47 +0200 Subject: [PATCH 09/17] Add util check --- .../workflows/create-release-nym-vpn-core.yml | 10 +++++----- .../bump-nym-vpn-app-to-next-dev-version.sh | 1 + .../bump-nym-vpn-core-to-next-dev-version.sh | 16 ++++++++++++++++ scripts/common.sh | 18 ++++++++++++++++++ scripts/create-nym-vpn-app-release.sh | 1 + scripts/create-nym-vpn-core-release.sh | 15 +++++++++++++++ scripts/update-nym-vpn-apple-to-latest-core.sh | 1 + 7 files changed, 57 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index c1fe4d6cef..19fd6c762c 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -59,11 +59,11 @@ jobs: run: | ./scripts/create-nym-vpn-core-release.sh --yes - - name: Run update-nym-vpn-apple-to-latests-core.sh - run: | - ./scripts/update-nym-vpn-apple-to-latest-core.sh - git diff - git commit -a -m "Update Info.plist" + # - name: Run update-nym-vpn-apple-to-latests-core.sh + # run: | + # ./scripts/update-nym-vpn-apple-to-latest-core.sh + # git diff + # git commit -a -m "Update Info.plist" - name: Run bump-nym-vpn-core-to-next-dev-version.sh run: | 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 From ea8c54565639af0fac7696317ec07b3e1cf293a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 09:20:49 +0200 Subject: [PATCH 10/17] add status step --- .github/workflows/create-release-nym-vpn-core.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 19fd6c762c..f6cd4e892b 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -75,12 +75,18 @@ jobs: # git commit -m "Bump version to next dev version" # git push origin ${{ env.branch_name }} + - name: git status + run: | + git status + git diff + - name: Open a Pull Request uses: peter-evans/create-pull-request@v7 with: branch: ${{ env.branch_name }} title: "Release: ${{ env.branch_name }}" body: "Automated PR for the release." + base: "main" draft: true # - name: Push the new branch and tags From 981f258e2b5402544c50f6d1f878b16f4c3802bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 09:24:18 +0200 Subject: [PATCH 11/17] Remove echo --- .github/workflows/create-release-nym-vpn-core.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index f6cd4e892b..3037259816 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -14,7 +14,6 @@ jobs: run: | user_role=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ "https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission") - echo "$user_role" permission=$(echo "$user_role" | jq -r '.permission') if [ "$permission" == "admin" ]; then From e83f6257a00b913d3ccab0b9e5a38649d0e4cadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 09:39:03 +0200 Subject: [PATCH 12/17] Use non-protected branch name --- .github/workflows/create-release-nym-vpn-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 3037259816..a97715712f 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -46,7 +46,7 @@ jobs: - name: Setup branch name id: create_branch run: | - BRANCH_NAME="release/nym-vpn-core-$(date +'%Y%m%d%H%M%S')" + 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 From 8b4afee0506ade7448bad3e0599ae436ff63aa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 10:18:00 +0200 Subject: [PATCH 13/17] cleanup --- .../workflows/create-release-nym-vpn-core.yml | 99 +++++++++++-------- 1 file changed, 58 insertions(+), 41 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index a97715712f..0e41af0457 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -26,8 +26,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - create_release: + create_version: 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: @@ -47,8 +49,8 @@ jobs: 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 + git checkout -b $BRANCH_NAME + echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT - name: Install cargo-edit, cargo-get run: | @@ -58,53 +60,68 @@ jobs: run: | ./scripts/create-nym-vpn-core-release.sh --yes - # - name: Run update-nym-vpn-apple-to-latests-core.sh - # run: | - # ./scripts/update-nym-vpn-apple-to-latest-core.sh - # git diff - # git commit -a -m "Update Info.plist" + - name: Push commit with version bump to new branch + run: | + git push origin HEAD:${{ steps.create_branch.outputs.branch_name }} - - name: Run bump-nym-vpn-core-to-next-dev-version.sh + update_nym_vpn_apple: + needs: create_version + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.create_version.outputs.branch_name }} + + - name: Set up Git user run: | - ./scripts/bump-nym-vpn-core-to-next-dev-version.sh --yes + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" - # - name: Commit bumped version - # run: | - # git add . - # git commit -m "Bump version to next dev version" - # git push origin ${{ env.branch_name }} + - 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: Install cargo-edit, cargo-get + run: | + cargo install --locked cargo-edit cargo-get - - name: git status + - name: Run update-nym-vpn-apple-to-latest-core.sh run: | - git status + ./scripts/update-nym-vpn-apple-to-latest-core.sh git diff + git commit -a -m "Update Info.plist" + git push - - name: Open a Pull Request + create_pull_request: + needs: [create_version, 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.create_version.outputs.branch_name }} + + - 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: ${{ env.branch_name }} - title: "Release: ${{ env.branch_name }}" + ref: ${{ needs.create_version.outputs.branch_name }} + title: "Release: ${{ needs.create_version.outputs.branch_name }}" body: "Automated PR for the release." base: "main" draft: true - - # - 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 " - From 7f4b0eb8ccebcc80f80969c7dca7de5b83ad478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 12:29:44 +0200 Subject: [PATCH 14/17] Tweak some job names --- .../workflows/create-release-nym-vpn-core.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 0e41af0457..1897761244 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -26,7 +26,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - create_version: + set_release_version_and_create_branch: needs: check_admin_permission outputs: branch_name: ${{ steps.create_branch.outputs.branch_name }} @@ -65,14 +65,14 @@ jobs: git push origin HEAD:${{ steps.create_branch.outputs.branch_name }} update_nym_vpn_apple: - needs: create_version + needs: set_release_version_and_create_branch runs-on: macos-latest steps: - name: Checkout Repository uses: actions/checkout@v4 with: - ref: ${{ needs.create_version.outputs.branch_name }} + ref: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} - name: Set up Git user run: | @@ -96,10 +96,10 @@ jobs: ./scripts/update-nym-vpn-apple-to-latest-core.sh git diff git commit -a -m "Update Info.plist" - git push + git push origin HEAD:${{ needs.set_release_version_and_create_branch.outputs.branch_name }} - create_pull_request: - needs: [create_version, update_nym_vpn_apple] + 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 @@ -107,7 +107,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 with: - ref: ${{ needs.create_version.outputs.branch_name }} + ref: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} - name: Install cargo-edit, cargo-get run: | @@ -120,8 +120,8 @@ jobs: - name: Create PR uses: peter-evans/create-pull-request@v7 with: - ref: ${{ needs.create_version.outputs.branch_name }} - title: "Release: ${{ needs.create_version.outputs.branch_name }}" + ref: ${{ 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 From ed274a4c672b6fd8c701b41a957c04d07f657dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 12:34:54 +0200 Subject: [PATCH 15/17] Remove unused wf for old desktop app --- .../workflows/build-nym-vpn-desktop-linux.yml | 121 ------------- .../workflows/build-nym-vpn-desktop-mac.yml | 141 --------------- .../build-nym-vpn-desktop-windows.yml | 166 ------------------ .../workflows/generate-build-info-desktop.yml | 49 ------ .github/workflows/publish-nym-vpn-desktop.yml | 163 ----------------- .../release-notes-desktop-nightly.md | 13 -- .../release-notes/release-notes-desktop.md | 27 --- 7 files changed, 680 deletions(-) delete mode 100644 .github/workflows/build-nym-vpn-desktop-linux.yml delete mode 100644 .github/workflows/build-nym-vpn-desktop-mac.yml delete mode 100644 .github/workflows/build-nym-vpn-desktop-windows.yml delete mode 100644 .github/workflows/generate-build-info-desktop.yml delete mode 100644 .github/workflows/publish-nym-vpn-desktop.yml delete mode 100644 .github/workflows/release-notes/release-notes-desktop-nightly.md delete mode 100644 .github/workflows/release-notes/release-notes-desktop.md 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/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} -``` From 11ad6e444d18331c9f4bd3186f0d461404afd835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 17:36:11 +0200 Subject: [PATCH 16/17] Add git user --- .github/workflows/create-release-nym-vpn-core.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 1897761244..6b5c355a6e 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -109,6 +109,11 @@ jobs: 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 From 929a83412eec95dd93f539db33911e40d291c117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sun, 29 Sep 2024 17:50:31 +0200 Subject: [PATCH 17/17] fix action --- .github/workflows/create-release-nym-vpn-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-nym-vpn-core.yml b/.github/workflows/create-release-nym-vpn-core.yml index 6b5c355a6e..c251cfb894 100644 --- a/.github/workflows/create-release-nym-vpn-core.yml +++ b/.github/workflows/create-release-nym-vpn-core.yml @@ -125,7 +125,7 @@ jobs: - name: Create PR uses: peter-evans/create-pull-request@v7 with: - ref: ${{ needs.set_release_version_and_create_branch.outputs.branch_name }} + 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"