From 2fbed8b879eb13bf009a90b044871f9252da9c49 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Mon, 22 Dec 2025 15:05:49 -0800 Subject: [PATCH 1/7] chore(nix): sync version number with latest version Former-commit-id: ca341a8bb07735a36e03e819c89616d68f2febfb --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 6d2f03f..112ec02 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ inherit (pkgs) lib; # Update version when releasing - version = "1.7.0"; + version = "1.8.0"; in { default = self.packages.${system}.pangolin-newt; From c50a2ea93b548f49604228ecbbb0352345ce34ba Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Mon, 22 Dec 2025 15:27:21 -0800 Subject: [PATCH 2/7] fix(nix): disable tests, set meta.mainProgram for package Former-commit-id: f078136b5afaea86fa5e423b52ddf860469b150c --- flake.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/flake.nix b/flake.nix index 112ec02..03e2e5f 100644 --- a/flake.nix +++ b/flake.nix @@ -37,14 +37,26 @@ vendorHash = "sha256-5Xr6mwPtsqEliKeKv2rhhp6JC7u3coP4nnhIxGMqccU="; + nativeInstallCheckInputs = [ pkgs.versionCheckHook ]; + env = { CGO_ENABLED = 0; }; ldflags = [ + "-s" + "-w" "-X main.newtVersion=${version}" ]; + # Tests are broken due to a lack of Internet. + # Disable running `go test`, and instead do + # a simple version check instead. + doCheck = false; + doInstallCheck = true; + + versionCheckProgramArg = [ "-version" ]; + meta = { description = "A tunneling client for Pangolin"; homepage = "https://github.com/fosrl/newt"; @@ -52,6 +64,7 @@ maintainers = [ lib.maintainers.water-sucks ]; + mainProgram = "newt"; }; }; } From 51dc2ca875017c1c36ab38d44ba3184b51a22aba Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Mon, 22 Dec 2025 15:27:49 -0800 Subject: [PATCH 3/7] ci: build nix package when go.mod is changed Former-commit-id: baf1b9b972ecca763d05ec9b28f26d4d65b14d5e --- .github/workflows/nix-build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/nix-build.yml diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml new file mode 100644 index 0000000..a97bcbd --- /dev/null +++ b/.github/workflows/nix-build.yml @@ -0,0 +1,23 @@ +name: Build Nix package + +on: + workflow_dispatch: + pull_request: + paths: + - go.mod + - go.sum + +jobs: + nix-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Build flake package + run: | + nix build .#pangolin-newt -L From d0b1876ac4cb2135c87da9607195f98f1c84d468 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Mon, 22 Dec 2025 15:34:32 -0800 Subject: [PATCH 4/7] chore: add direnv and nix result dirs to gitignore Former-commit-id: 0e961761b86ec1dab25854cac605debde5bf0492 --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ad2355b..e39f130 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ nohup.out *.iml certs/ newt_arm64 -key \ No newline at end of file +key +/.direnv/ +/result* From dfad7d852a65875e9930623de8b80d8ae1f23a15 Mon Sep 17 00:00:00 2001 From: Varun Narravula Date: Mon, 22 Dec 2025 15:35:43 -0800 Subject: [PATCH 5/7] ci: update nix go vendor hash if needed for dependabot PRs Former-commit-id: f9b6f36b4f9d43f7d7b1d30099f39796778a0d55 --- .../workflows/nix-dependabot-update-hash.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/nix-dependabot-update-hash.yml diff --git a/.github/workflows/nix-dependabot-update-hash.yml b/.github/workflows/nix-dependabot-update-hash.yml new file mode 100644 index 0000000..7e255f0 --- /dev/null +++ b/.github/workflows/nix-dependabot-update-hash.yml @@ -0,0 +1,48 @@ +name: Update Nix Package Hash On Dependabot PRs + +on: + pull_request: + types: [opened, synchronize] + branches: + - main + +jobs: + nix-update: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + + - name: Run nix-update + run: | + nix run nixpkgs#nix-update -- --flake pangolin-newt --no-src --version skip + + - name: Check for changes + id: changes + run: | + if git diff --quiet; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Commit and push changes + if: steps.changes.outputs.changed == 'true' + run: | + git config user.name "dependabot[bot]" + git config user.email "dependabot[bot]@users.noreply.github.com" + + git add . + git commit -m "chore(nix): fix hash for updated go dependencies" + git push From b87b8c3168577590a86eb568234018f119252aed Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 22 Dec 2025 21:32:40 -0500 Subject: [PATCH 6/7] Fix latest tag Former-commit-id: e1ee4dc8f21a27645f39d251515d6afd0f31304a --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 6474fb7..69b98b9 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -273,7 +273,7 @@ jobs: tags: | type=semver,pattern={{version}},value=${{ env.TAG }} type=semver,pattern={{major}}.{{minor}},value=${{ env.TAG }},enable=${{ env.PUBLISH_MINOR == 'true' && env.IS_RC != 'true' }} - type=raw,value=latest,enable=${{ env.PUBLISH_LATEST == 'true' && env.IS_RC != 'true' }} + type=raw,value=latest,enable=${{ env.IS_RC != 'true' }} flavor: | latest=false labels: | From 8deb6b226a41e80195f63e0a29adb5d8259da077 Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 23 Dec 2025 17:54:31 -0500 Subject: [PATCH 7/7] Dont run on v tags Former-commit-id: d754cea397acda599028a9752cbf02e140b84a08 --- .github/workflows/cicd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 69b98b9..4edb510 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -11,7 +11,9 @@ permissions: on: push: tags: - - "*" + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" + workflow_dispatch: inputs: version: